This blog post is part of C# 6.0 Features Series.As we know there are lots of small features added in C# 6.0 and Null conditional operator is one of them. You can check null with specific conditions with Null conditional operator and this will definitely increase productivity of developers and there will be less lines of code.
Let’s create example. Following are two classes I have created for this example. Address class will contains two properties like Street and City.
namespace NullConditionalOperator { public class Address { public string Street { get; set; } public string City { get; set; } } }And Same way Person class contains four properties Id,FirstName,Lastname and Address which is of type Address class which we have created.