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.