title: Await or Task.FromResult
body: <p>I have one service lets say,</p>
  
  <pre><code>public interface ISomeService
  {
      Task&lt;bool&gt; DoSomeExpensiveCheckAsync(string parameter);
  }
  </code></pre>
  
  <p>And I have this class to consume the service. It just needs to do some simple null checks and then return the service response back.    </p>
  
  <pre><code>public class SomeServiceConsumer
  {
      private readonly ISomeService _serviceClient;
  
      public SomeServiceConsumer(ISomeService serviceClient)
      {
          _serviceClient = serviceClient;
      }
  
      public async Task&lt;bool&gt; DoSomething1Async(string someParameter)
      {
          if (string.IsNullOrWhiteSpace(someParameter))
          {
              return false;
          }
          return await _serviceClient.DoSomeExpensiveCheckAsync(someParameter);
      }
  
      //No async or await keywords   
      public Task&lt;bool&gt; DoSomething2Async(string someParameter)
      {
          if (string.IsNullOrWhiteSpace(someParameter))
          {
              return Task.FromResult(false);
          }
          return _serviceClient.DoSomeExpensiveCheckAsync(someParameter);
      }
  }
  </code></pre>
  
  <p>Should I do <code>DoSomething1Async</code> or <code>DoSomething2Async</code>?</p>
  
  <p>According to <a href="https://stackoverflow.com/a/15444389/321035">this answer</a>, I should not wrap with an unnecessary <code>await</code> but then I have to use <code>Task.FromResult(false)</code> for shortcircuiting as in <code>DoSomething2Async</code></p>
  
  <p>But according to <a href="https://stackoverflow.com/a/19103343/321035">this answer</a> there are cases with <code>try/catch</code> and <code>using</code> statements where I actually should <code>await</code> before returning.</p>
  
  <p>Am I correct in saying then, that</p>
  
  <ol>
  <li><p>If I have to use <code>try/catch</code> or <code>using</code> then I should <code>await</code></p></li>
  <li><p>Otherwise do not <code>await</code> if you are only going to return. And use <code>Task.FromResult</code> for short circuiting</p></li>
  </ol>
  
  <p>I like <code>DoSomething1Async</code> more, and want to do that everywhere if someone says it doesnt matter :).</p>