title: Async/Await and multi-layer web application
body: <p>Because of some optimalization issues, i decided to rewrite controller's action method to asynchronous one. It is a multi-layer application, and since that, i'm facing an architecture problem, and i wonder what are the main differences between two approches I will show below. Let's say my synchronous method is:</p>
  
  <pre><code>public virtual ActionResult Method()
  {
     SomeLogic.LargeOperation();
     return View(...);
  }
  </code></pre>
  
  <p>LargeOpertation does a lot. Here's pseudocode:</p>
  
  <pre><code>public void LargeOpertion() {
     DatabaseManipulations1();
     IndependentWork();
     CallingToWebService1();
     IndependentWork();    
     DatabaseManipulations2();
     IndependentWork();
     CallingToWebService2();
     IndependentWork(); 
  }
  </code></pre>
  
  <p>Each method inside LargeOperations has couple methods inside itself, and so on ... The question is: Do I need to make them all async and use await in almost every of application layer? </p>
  
  <pre><code>public virtual Task&lt;ActionResult&gt; Method()
  {
     await SomeLogic.LargeOperation();
     return View(...);
  }
  
  public async Task LargeOpertion() {
     await DatabaseManipulations1();
     IndependentWork();
     await CallingToWebService1();
     IndependentWork();    
     await DatabaseManipulations2();
     IndependentWork();
     await CallingToWebService2();
     IndependentWork(); 
  }
  </code></pre>
  
  <p>Or can I just use task on LargeOpertaion like that:</p>
  
  <pre><code>public virtual Task&lt;ActionResult&gt; Method()
  {
     await Task.Run(() =&gt; SomeLogic.LargeOperation());
     return View(...);
  }
  </code></pre>
  
  <p>Let's also assume that IndependentWork() is not so large.</p>