object initializer

C# syntax that sets properties in braces right after new, such as new Product { Name = "Kettle", Price = 24.50m }.

In more detail

It runs after the constructor and is the only place init-only properties can be set outside the constructor. Collection initialisers do the same for adding items.

Related terms

Taught in

References