public async Task <GetRentalDto> CustomerUpdateRentalAsync(CustomerUpdateRentalDto item, CancellationToken ct = default) { var itemToUpdate = await _unitOfWork.RentalRepository.GetAsync(item.RentalId, ct); _mapper.Map(item, itemToUpdate); itemToUpdate.UpdatedAt = DateTime.UtcNow; _unitOfWork.RentalRepository.Update(itemToUpdate); await _unitOfWork.CommitAsync(ct); return(_mapper.Map <GetRentalDto>(itemToUpdate)); }
public async Task <ActionResult> CustomerUpdateRentalAsync([FromBody] CustomerUpdateRentalDto rental) { var result = await _rentalService.CustomerUpdateRentalAsync(rental); return(Json(JsonResultData.Success(result))); }