C# – specify a meaningful name for an anonymous class in C#

.netanonymous-classc#-3.0c++

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 type:

<>f__AnonymousType0<int,string>

Is there any way to specify a meaningful name to such classes?

Best Solution

public class Employee {}