Can I create an anonymous type variable and later on add more Properties?
E.g.
var x = new { Name = "Ahmed" }; and want to add Age to it?
how can I do this?
Another question: i saw on some blogs a type AnonymousType what is the name space for this class? here is am example http://www.codeproject.com/KB/cs/AnonymousTypesInCSharp.aspx
First question - you can't.
Second question - AnonymousType is the type the author of that article created. You have to download the source for his project to use that type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With