Tag: feature

Auto Property Initializers in C# 6.0

The .NET Framework 3.0 introduced the auto-implemented properties which was quite useful but it had one drawback . This did not have an option to specify the default value to the property . Here’s an example of the auto-implemented property in C#. If you had to specify the default value to property , you must either initialize the value in the constructor or by specifying…

Defining Simple Anoymous Type in C#

To define an anonymous type in C# , we can use the var keyword . The syntax for defining the anonymous type in C# is as follows var <variableName> = <Non-NULL Value> Eg: var WebsiteName = “Abundantcode.com”; In the MSIL , the above code is similar to