public async Task FinishLoan(int id, FinishLoanDTO loan) { var finishCommand = _Mapper.Map <FinishLoanCommand>(loan); finishCommand.LoanId = id; await _Bus.SendCommand(finishCommand); }
public async Task <IActionResult> FinishLoan([FromRoute] int id, [FromBody] FinishLoanDTO loan) { try { await _loanService.FinishLoan(id, loan); return(Accepted()); } catch (Exception e) { return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message)); } }