public async Task <IActionResult> Put(SpendingForEditDTO model) { Spending oldSpending = await spendingRepository.Get(model.Id).ConfigureAwait(true); Spending spending = mapper.Map <Spending>(model); spending.Date = oldSpending.Date; //spending.UserId = oldSpending.UserId; spendingRepository.Edit(spending); await unitOfWork.CompleteAsync().ConfigureAwait(true); return(Ok(mapper.Map <SpendingForGetDTO>(await spendingRepository.Get(spending.Id).ConfigureAwait(true)))); }