title: Return Type of an async method
body: <p>I have an async method in C# as follows:</p>
  <pre><code>public async Task&lt;string&gt; GetData(int id)
  {
      Task&lt;string&gt; inp =  CommonMethod(id);
      return inp;
  }
  
  public async Task&lt;string&gt; CommonMethod(int id)
  {
      string output;
      output = await service.GetSomeDummyData(id);
      return output;
  }
  
      
  </code></pre>
  <p>I am getting an error message</p>
  <blockquote>
  <p>Since this is an async method,the return expression must be of type string rather than <code>Task&lt;string&gt;</code>.</p>
  </blockquote>
  <p>SO, I converted the return type as :</p>
  <pre><code>public async Task&lt;string&gt; GetData(int id)
  {
      Task&lt;string&gt; inp =  CommonMethod(id);
      return inp.ToString();
  }
  </code></pre>
  <p>The code is getting complied successfully .</p>
  <p>I am new to asynchronous programming, is the above conversion method is a best practice of returning <strong>string</strong>? Because from the <strong>CommonMethod</strong>,
  I am collecting the return type in <code>Task&lt;string&gt;</code> , and in the next statement I am using <code>inp.Tostring()</code>. Little bit of Dilemma in using the correct return types.</p>