title: writing async Repository methods inside my asp.net mvc5 web application
body: <p>I am working on an asp.net mvc5 web application + Entity Framework 6. and I want to have a repository model class inside my application. currently I am following this approach to have async action methods and async repository model class.</p>
  
  <p>for example I have the following repository save method:</p>
  
  <pre><code>public class Repository
  {
      private Entities t = newEntities();
  
      public async Task Save()
      {
          await t.SaveChangesAsync();
      }
  </code></pre>
  
  <p>which I am calling from my action methods as follow:</p>
  
  <pre><code>Repository repository = new Repository();
   public async Task&lt;ActionResult&gt; GetResourceByName(string resourcename)
        {
           await  repository.Save();
        }
  </code></pre>
  
  <p>so is this a correct approach? as I am doing the following:</p>
  
  <ol>
  <li><p>I define the repository method as a Task &amp; also the Action method as Task. so should I have both of them as Task(s).?</p></li>
  <li><p>I am using <code>await</code> twice on the action method (when calling the repo method) and on the repository? so are these <code>await</code> redundant?</p></li>
  </ol>
  
  <p>//please note that this is only a simple example of a repository method  which is just used to save model,, but I am asking about the approach itself as I will be using this approach in a more complex repository methods ..</p>