首页 > 解决方案 > 如何将字符串属性中的值分配给属性对象

问题描述

我有 2 个属性

   public MeasureDiameterMethodEnt PrimaryCalcMethod { get; set; }
   public MeasureDiameterMethodEnt SecondaryCalcMethod { get; set; }

以及来自数据库的具有两个值(PrimaryCalcMethod、SecondaryCalcMethod)值的属性。

public string CalcMethodName { get; set; }

如何将字符串属性 CalcMethodName 中的值“PrimaryCalcMethod”分配给属性对象 PrimaryCalcMethod?如何将字符串属性 CalcMethodName 中的值“SecondaryCalcMethod”分配给属性对象 SecondaryCalcMethod?

标签: c#

解决方案


推荐阅读