title: SaveChangesAsync not updating value in database table
body: <p>This is my Table:<strong>Statistics</strong></p>
  
  <pre><code>Id,Depth,RefreshCounter
  </code></pre>
  
  <p>Sample Records:</p>
  
  <pre><code>Id    Depth      RefreshCounter
   1     1           1
   2     1           0
   3     1           0
   4     1           0
  </code></pre>
  
  <p><strong>Now what i need to do is whenever i am refreshing the page i need to increment this refreshcounter value by 1 in Database table with Depth 1</strong>.</p>
  
  <p>I am calling this method like this on load of my view page:</p>
  
  <pre><code>@Html.Action("IncrementRefreshcounter", "Statistics", new { id = 1})  //for eg:1,2,3,4
  </code></pre>
  
  <p>Here is my code which does this:</p>
  
  <pre><code>    [ChildActionOnly]
      public ActionResult IncrementRefreshcounter(int id)
         {
           using ( var context = new MyDBContext())
           {
  //at each page refresh i would be passing different id to my controller from view.for eg 1,2,3,4
           var data=context.Statistics.where(x=&gt;x.Depth==1 &amp;&amp; r.Id==id).FirstorDefualt();
               context.RefreshCounter++;//Increment here RefreshCounter.
               context.SaveChangesAsync();
               return PartialView("xxx")
              }
          }
  </code></pre>
  
  <p>I am calling this method when my View Loads.Problem is when i run my Application first time and calling this method it successfully updated RefreshCounter by 1 but after that whenever i refresh my page and calling this method it never updated RefreshCounter for any records with Depth=1.</p>
  
  <p>In my sample Records you can see that Id 1 with Depth 1 have refresh counter with value 1 because it was the first time when i have run my application and it has successfully updated that value but after that it is never updating any value for eg:Id 2 Depth 1</p>
  
  <p>It is incrementing only 1 time RefreshCounter but after that it never increments that variable.</p>
  
  <p>Can anybody tell me what the problem is <strong>SaveChangesAsync</strong> ??</p>