Projecting Sequence into New Types

Learn about object initialization syntax and how to efficiently use object initialization in LINQ projections.

Object initialization

Before we look at projection, we need to review object initialization syntax. If we have a class defined, then we can instantiate an object using the class name, new(), and curly braces to set initial values for fields and properties, as shown in the following code:

Get hands-on with 1400+ tech skills courses.