Anonymous Types in C#

The Anonymous types feature was introduced in version 3.0 of the C# language with a special purpose in mind and that purpose was to provide an easier way to define objects with a few read-only properties.

In the traditional way, we need to create a class and define read-only properties of the class and that’s it. Nothing more. So the C# development team added anonymous types to avoid the need for definition of the classes. The C# compiler understands when an anonymous type is defined. Each property of the class is inferred by the compiler.  Continue reading