We all know that when we create an anonymous class like this:
var Employee = new { ID = 5, Name= \"Prashant\" };
...at run time it will be of t
It's an anonymous type, that defeats the purpose. Those objects are designed to be temporary. Hell, the properties are even read-only.
Sorry, I'm being a smart-ass. The answer is no, there is no way to tell the compiler what name to use for an anonymous type.
In fact, the names of the types generated by the compiler use illegal characters in their naming so that you cannot have a name collision in your application.