Indent chained method calls so they all start at the same position below each other

Consider the following code formatting, taken from this answer. var query = grades.GroupBy(student => student.Name) .Select(group => new { Name = group.Key, Students = group.OrderByDescending(x => x.Grade) }) .OrderBy(group => group.Students.First().Grade); Note how the calls to GroupBy, Select and OrderBy all start exactly at the same position / are directly aligned below each other. How… Read More Indent chained method calls so they all start at the same position below each other

How to avoid getting "possible "null"assignment to a non-nullable entity"

Sorry for this awkward example, but I want to keep it as to the point as possible Lets say, I have parsed a json-file, which gives me the hierarchy below var customers = myObj.SubObj?.CustomerList.EmptyIfNull(); var plusCustomers = customers.Where(…) // Resharper warning myobj cannot be null SubObject can be null sometimes I have an extension method… Read More How to avoid getting "possible "null"assignment to a non-nullable entity"