C# Anonymous types

Updated: 28 January 2023

Anonymous types provide a convenient way to encapsulate a set of read-only properties into a single object without having to explicitly define a type first.

var v = new { Amount = 108, Message = "Hello" };

Leave a comment