Saber
Saber

Reputation: 5660

How do I Format Linq methods to stack vertically with Resharper?

Is there a way in Resharper to format all linq methods to stack up on each other vertically. I have some code which look like this:

xTable.Include(x => x.RelatedTable.Select(y => y.Childrens)).Include(x => x.SomeField).Where(x => x.Guid == token).ToList();

I would like to format the code to look like this:

    xTable.Include(x => x.RelatedTable.Select(y => y.Childrens))
          .Include(x => x.SomeField)
          .First(x => x.Guid == token)
          .ToList();

Upvotes: 3

Views: 774

Answers (1)

LordWilmore
LordWilmore

Reputation: 2912

I think you're after one of these two items in the Options page:

Code Editing
  ->C#
    ->FormattingStyle
      ->Other
        -> Align Multiline Constructs
          -> 1) LINQ query
          -> 2) Chained method calls

Upvotes: 5

Related Questions