title: How to use await in asp.net webapi post method
body: <p>I am using entity framework and asp.net web API. I want to make the following method async but I do not know where to use await in following code.</p>
  
  <pre><code>[HttpPost]
  public async Task&lt;IHttpActionResult&gt; CreateAccount([FromUri]string fullname, string email, string cnic,string username,string password, string logrol )
  {
  
      using (var entity = new Smock_DBEntities())
      {
          Person pr = new Person();
          pr.Full_Name = fullname;
          pr.Email = email;
          pr.CNIC = cnic;
          entity.Persons.Add(pr);
          entity.SaveChanges();
          int prID = entity.Persons.Where(per =&gt; per.CNIC == cnic).Select(per =&gt; per.Person_ID).First();
  
          Login log = new Login();
          log.Person_ID = prID;
          log.Username = username;
          log.Password = password;
          log.Login_Role = logrol;
          entity.Logins.Add(log);
          entity.SaveChanges();
  
          return Ok();
      }         
  }
  </code></pre>