title: async POST method C# '': not all code paths return a value
body: <p>As I'm listening to lots of POST requests I'm trying to do it asynchronous with Promise like methodology.</p>
  
  <p>The issue is that it it requires a return value outside of the "getDataLead" task(this case to uncomment the <code>return "good2</code>" part).</p>
  
  <p>Any ideas how can I make it so the POST method waits and returns the response from the asynced "matchLogic" function?</p>
  
  <pre><code>   [HttpPost]
      public async Task&lt;string&gt; Post([FromForm]string id)
      {          
          String filterType = "id";             
          string filterValues = id;            
  
          int batchSize = 50;//max 300, default 300
          String[] fields = { "email", "country", "city", "address", "postalCode", "phone", "company", "billingCountry", "billingCity", "billingPostalCode", "billingStreet", "mainPhone", "website" };//array of field names to retrieve
          String nextPageToken = "";//paging token
  
          Task&lt;string&gt; tr = await getDataLead(filterType, filterValues, batchSize, fields, nextPageToken).ContinueWith((t1) =&gt;
              {
  
                  if (t1.Exception == null)
                  {
                      getLeadsByFilterTypeRootObject data = JsonConvert.DeserializeObject&lt;getLeadsByFilterTypeRootObject&gt;(t1.Result);
                      if (data.success == true)
                      {
                          if (data.result.Count &lt; 2)
                          {
                              return matchLogic(data.result[0]);                            
                          }
                          else
                          {
                              return Task.FromResult("not good");
                          }
                      }
                      else
                      {
  
                          return Task.FromResult("not good");
                      }
                  }
                  else
                  {
                      return Task.FromResult("not good");
                  }  
              });         
  
          //   return "good2";
  
      }
  </code></pre>
  
  <p>Thank you</p>