For example, I am trying to create five anonymous objects to put in the List
, but I want to name properties differently, is that possible?'
List<dynamic> myObjects = new List<dynamic>();
for(int i=0;i<5;i++)
{
//do this
var obj = new { Prop+i = "some value" };
//or
obj."somehow change property name here";
myObjects.Add(obj);
}
So my properties would be named: Prop0, Prop1, Prop2, Prop3, Prop4