CSharp / C# Collection initializer example

A very simple way to use Collection Initializer in C#.

Example:

using System; using System.Collections.Generic;

class MainExample { static void Main(string[] args) {

//Collection initializer way List obj = new List { new Employee {FirstName = “Human” , LastName = “Being” , Age = 52}, new Employee {FirstName = “Being” , LastName [...]