2017-01-11 49 views
1

Resharper中有一種方法可以將所有linq方法格式化爲垂直堆疊。 我有一些代碼,如下所示:如何格式化Linq方法與Resharper垂直堆疊?

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

我想格式化代碼看起來像這樣:

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

回答

2

我覺得你在選擇這兩個項目一個是後頁碼:

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