/// <summary> /// Maps ReceiptRowId, Amount /// </summary> /// <param name="dto"></param> /// <returns></returns> /// <exception cref="NullReferenceException"></exception> public static BLLReceiptRowDTO FromAPI(ReceiptRowAmountChangeDTO dto) { if (dto == null) { throw new NullReferenceException("Can't map, ReceiptRowAmountChangeDTO is null"); } return(new BLLReceiptRowDTO() { Amount = dto.NewAmount, ReceiptRowId = dto.ReceiptRowId }); }
public async Task <ActionResult <ReceiptRowAllDTO> > UpdateRowAmount(ReceiptRowAmountChangeDTO dto) { if (dto == null) { return(BadRequest("DTO missing")); } var receiptRow = await _bll.ReceiptsService.UpdateRowAmount(ReceiptRowMapper.FromAPI(dto), User.GetUserId()); if (receiptRow == null) { return(BadRequest()); } return(ReceiptRowMapper.FromBLL(receiptRow)); }