title: How To use ExecuteSqlCommandAsync
body: <p>I've been trying to figure out <code>ExecuteSqlCommandAsync</code>, which I haven't been able to find any good documentation on.  </p>
  
  <pre><code>if (OldMarketRightsIDs.Count &gt; 0)
  {
      //This is where I want to have the task Begin        
      TaskReturn = Data.MK3Model.Database.ExecuteSqlCommandAsync("DELETE FROM TitleMarketRights WHERE ID in (" + string.Join(", ", OldMarketRightsIDs) + ")");
  }
  
  //This is the Code I want To execute in between
  var NewMarketRights = MarketRights.Select(m =&gt; new
  {
      Key = m.Key,
      Value = m.Value.Except(CurrentMarketRights[m.Key].Select(c =&gt; c.FK_ProductRight).ToList())
  }).ToList();
  
  foreach (var mr in NewMarketRights)
  {
      foreach (var ProdID in mr.Value)
      {
          Data.MK3Model.TitleMarketRights.Add(new TitleMarketRight { FK_MarketID = (mr.Key == 0) ? null : (int?)mr.Key, FK_TitleID = ID, FK_ProductRight = ProdID });
      }
  }
  
  //This is where I want to wait until the task is complete before continuing
  var i = await TaskReturn;
  </code></pre>
  
  <p>This Example doesn't compile, it gets an error await operator can only be used with an async Method.  Any Ideas on how to get this working</p>