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.
[HttpPost]
public async Task<IHttpActionResult> 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 => per.CNIC == cnic).Select(per => 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();
}
}