public async Task <IActionResult> Update([FromBody] UpdateUpcomingExpense dto) { if (dto == null) { return(BadRequest()); } try { dto.UserId = IdentityHelper.GetUserId(User); } catch (UnauthorizedAccessException) { return(Unauthorized()); } await _upcomingExpenseService.UpdateAsync(dto); return(NoContent()); }
public async Task UpdateAsync(UpdateUpcomingExpense model) { var upcomingExpense = _mapper.Map <UpcomingExpense>(model); await _upcomingExpensesRepository.UpdateAsync(upcomingExpense); }