public async Task <IHttpActionResult> CreateAsync(AccountDto account) { _accountRepository.Add(account.Map <Account>()); await UnitOfWork.CompleteAsync(); return(Created(new Uri(Request.RequestUri + "/" + account.Id), account)); }
public async Task <IHttpActionResult> UpdateAsync(int id, AccountDto account) { var accountInDb = await _accountRepository.GetAsync(id); if (accountInDb == null) { return(NotFound()); } _accountRepository.Add(account.Map <Account>()); await UnitOfWork.CompleteAsync(); return(Ok()); }