title: Save Records in Database asynchronously Or Parallely in .net c#
body: <p>I have a service in which i have to save a large number of records to database after getting from an API.
      At the same time i have to return those records to from service to the caller.
      But problem is that i saving records in DB is taking long time so Service is getting slow.
  I have searched about this and found some conecept of Parallel task OR async &amp; await.</p>
  
  <p>I am new to this concept and getting confused in its usage</p>
  
  <p>I looked into :</p>
  
  <p><a href="https://stackoverflow.com/questions/3758510/running-multiple-c-sharp-task-async">Running multiple C# Task Async</a>
  <a href="http://msdn.microsoft.com/en-us/library/hh191443.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/hh191443.aspx</a></p>
  
  <p>But i am not getting what to do.Please help me:</p>
  
  <p>below is code:</p>
  
  <pre><code>public List&lt;SearchedItems&gt; SearchItems(string ItemToSearch, string AuthenticationToken)
  {
      var _list= getRecords from Api //100 records    
  
       //Task&lt;int&gt;.Factory.StartNew(() =&gt; _objBLLNutritionLog.FillNutritionTable(_tempList)); // also tried this
  
      saveToDb(_list); // need to run this asynchronously Or parallel (Taking long time)
  
      return _list;
  
  }
  </code></pre>
  
  <p>i want to return result to caller and on other side want to fill db.
  Please suggest.</p>
  
  <p>Thank you</p>