C# From Beginning till 6.0

What is C#: C# is an Object-Oriented language

Evolution of C#: Following image shows the journey of C# till 6.0

c_evolution

C# 6.0 new features:

  • Auto-Property Initializer: As name suggests, it allows developer to set the value of the property when it is declared in class. Earlier, one need to set value in the constructor

public class Blog

    {

        public string Name {get; set;}

        public Blog ()

        {

            Name = “Name”;

        }

}

But in C# 6.0 this can be like this

public class Blog

  {

          public string Name {ge; set;} = “Name”;

 }

One can also set different accessor for ‘get, set’ properties Continue reading “C# From Beginning till 6.0”