title: Should async lamda run in async function?
body: <p>So I have the following code with a few more methods other than Set or Delete but I'll keep it short for simplicity:</p>
  
  <pre><code>public byte[] Get(string key)
  {
      byte[] Action() =&gt; this.Cache.Get(key);
      return this.Execute(Action);
  } 
  
  public void Delete(string key)
  {
      void Action() =&gt; this.Cache.Delete(key);
      return this.Execute(Action);
  }
  
  private void Execute(Action action)
  {
      this.Execute(() =&gt;
      {
          action();
          return 0;
      });
  }
  
  private T Execute&lt;T&gt;(Func&lt;T&gt; action)
  {
      if (someCondition)
      {
          try
          {
              return action();
          }
          catch (Exception)
          {
              //do something
          }
      }
      else
      {
          //do something else
      }
  
      return default(T);
  }
  </code></pre>
  
  <p>Now I want to make this code async. I've tried doing:</p>
  
  <pre><code> public async Task&lt;byte[]&gt; GetAsync(string key)
   {
       async Task&lt;byte[]&gt; Action() =&gt; await this.Cache.GetAsync(key);
       return await this.Execute(Action);
   }
  
  public async Task DeleteAsync(string key)
  {
      void Action() =&gt; this.Cache.DeleteAsync(key);
      await this.Execute(Action);
  }
  
  
  private void Execute(Action action)
  {
      this.Execute(() =&gt;
      {
          action();
          return 0;
      });
  }
  
  private T Execute&lt;T&gt;(Func&lt;T&gt; action)
  {
      if (someCondition)
      {
          try
          {
              return action();
          }
          catch (RedisConnectionException)
          {
              //do something
          }
      }
      else
      {
          // do something else
      }
  
      return default(T);
  }
  </code></pre>
  
  <p>It compiles and seems to work, but I have no idea if it is actually async or not. It seems weird that the Execute method is not async and does not return a Task. I did not find a way to make the Execute method async without getting errors and warnings. 
  So my question is: In the second version of the code, will the executtion of the action </p>
  
  <pre><code>return action();
  </code></pre>
  
  <p>be async or sync?</p>
  
  <p>Bonus question: Is there a way to test if something runs async or not? A way I could manually verify the "asyncness" of the code</p>