This blog post is part of C# 6.0 Features Series.Microsoft announced the new version of C# 6.0 at the day of visual studio connect event on November. They have not added any big features to C# 6.0 but they have listened to community and added few small features which comes really handy. One of the that is nameof operator. In this blog post we learn why nameof operator is very useful.
Let’s create a class Employee with few properties.
public class Employee { public string FirstName { get; set; } public string LastName { get; set; } }Now what I want to do here is to create a object with object initializer and print values of properties with print method.