I’m using var abc = new { id = 0 }; in my C# code without knowing what type it exactly is!
Is is simply called an object? Is it a particular type of object?
I want to know coz I don’t know how to add fields to this kind of object
Quick example:
I have var abc = new { id = 0 }; and I want to add to abc the field name = "david"
It is an anonymous type, that is, it does not have a type that you can use in code (though the compiler generates one).
MSDN says:
If you want to add a property, you can simply do so: