I have a list which contains dynamic data. i.e
list[0].id=0;
list[1].id=1;
list[2].id=2;
I want to create a class which will have dynamic property names i.e
for(int i=0;i<list.count;i++)
{
//create dynamic class with dynamic property name
new {id+i=list[i].id} //this statement throws compilation error.
}
what is alternative to this method?