title: Best ways to format LINQ queries
body: <p>Before you ignore / vote-to-close this question, I consider this a <em>valid</em> question to ask because <strong>code clarity</strong> is an important topic of discussion, it's essential to writing maintainable code and I would greatly appreciate answers from those who have come across this before.</p>
  
  <p>I've recently run into this problem, LINQ queries can get pretty nasty real quick because of the large amount of nesting.</p>
  
  <p>Below are some examples of the differences in formatting that I've come up with (for the same relatively non-complex query)</p>
  
  <p><strong>No Formatting</strong></p>
  
  <pre><code>var allInventory = system.InventorySources.Select(src =&gt; new { Inventory = src.Value.GetInventory(product.OriginalProductId, true), Region = src.Value.Region }).GroupBy(i =&gt; i.Region, i =&gt; i.Inventory);
  </code></pre>
  
  <p><strong>Elevated Formatting</strong></p>
  
  <pre><code>var allInventory = system.InventorySources
      .Select(src =&gt; 
          new { 
              Inventory = src.Value.GetInventory(product.OriginalProductId, true), 
              Region = src.Value.Region })
                  .GroupBy(
                      i =&gt; i.Region, 
                      i =&gt; i.Inventory);
  </code></pre>
  
  <p><strong>Block Formatting</strong></p>
  
  <pre><code>var allInventory = system.InventorySources
      .Select(
          src =&gt; new 
          { 
              Inventory = src.Value.GetInventory(product.OriginalProductId, true), 
              Region = src.Value.Region 
          })
          .GroupBy(
              i =&gt; i.Region, 
              i =&gt; i.Inventory
          );
  </code></pre>
  
  <p><strong>List Formatting</strong>     </p>
  
  <pre><code>var allInventory = system.InventorySources
      .Select(src =&gt; new { Inventory = src.Value.GetInventory(product.OriginalProductId, true), Region = src.Value.Region })
      .GroupBy(i =&gt; i.Region, i =&gt; i.Inventory);
  </code></pre>
  
  <p>I want to come up with a standard for linq formatting so that it maximizes readability &amp; understanding and looks clean and professional. So far I can't decide so I turn the question to the professionals here.</p>