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 can I automatically format my code like this with either Visual Studio directly or using Resharper?