public IHttpActionResult Update(Rp3.Test.Common.Models.Account account) { using (DataService service = new DataService()) { Rp3.Test.Data.Models.Account accountModel = new Test.Data.Models.Account(); accountModel.Email = account.Email; accountModel.FullName = account.FullName; accountModel.AccountId = account.AccountId; service.Accounts.Update(accountModel); service.SaveChanges(); } return(Ok(true)); }
public IHttpActionResult Insert(Rp3.Test.Common.Models.Account account) { using (DataService service = new DataService()) { Rp3.Test.Data.Models.Account accountModel = new Test.Data.Models.Account(); accountModel.Email = account.Email; accountModel.FullName = account.FullName; accountModel.AccountId = service.Accounts.GetMaxValue <int>(p => p.AccountId, 0) + 1; service.Accounts.Insert(accountModel); service.SaveChanges(); } return(Ok(true)); }