In c# I wanted to convert List to List and add new properties to object dynamically.
List<Customer> customerList; // has list of customer object
List<Properties> properties; // has { string:propertyname and string:value}
I wanted to add some properties dynamically to all customer object by iterating through the list similar to that of javascript in C# without loosing data in existing list of objects
I would get properties from other source.
How do I achieve this kind of behavior in C#.
for(Customer c in customerList)
{
for(Property prop in properties)
{
c[prop.propertyName]=prop.value; // similar to javascript
}
}
I would require this List to be accessed from my UI by making an API call and return the data in JSON format