0

我的视图模型中有一些属性。在运行时,我需要在该视图模型中再添加一个属性。

例如:

var avm= new AnalysisViewModel();

foreach (var grades in gradeList)
{
  avm = new AnalysisViewModel
  {
     InfractionAverage = searchResult.Where(x=>x.GradeId == grades),
     //Here i want to add one move property and  want to assign value for my list.  
  };
}

请指导我如何达到这个要求

4

1 回答 1

0

Hmm try with PropertyBuilder. http://msdn.microsoft.com/en-us/library/system.reflection.emit.propertybuilder.aspx

于 2013-01-06T10:01:41.777 回答