[HttpPost, Route("delete")] //, AmigoTenantClaimsAuthorize(ActionCode = ConstantsSecurity.ActionCode.ExpenseDelete)] public async Task <ResponseDTO> Delete(ExpenseDeleteRequest expense) { if (ModelState.IsValid) { return(await _expenseApplicationService.DeleteExpenseAsync(expense)); } return(ModelState.ToResponse()); }
public async Task <ResponseDTO> DeleteExpenseAsync(ExpenseDeleteRequest expense) { //Map to Command var command = _mapper.Map <ExpenseDeleteRequest, ExpenseDeleteCommand>(expense); //Execute Command var resp = await _bus.SendAsync(command); return(ResponseBuilder.Correct(resp)); }