public async Task <IActionResult> GetExpenseById(int expenseId) { var query = new GetExpenseByIdQuery(expenseId); var result = await Mediator.Send(query); return(result != null ? (IActionResult)Ok(result) : NotFound()); }
public async Task <Result <ExpenseDetailsVm> > Handle( GetExpenseByIdQuery request, CancellationToken cancellationToken) { return(await _expensesDataAccess .GetAsync(request.ExpenseId, cancellationToken)); }
public async Task <ActionResult <ShallowExpenseDto> > GetExpense(int id) { var query = new GetExpenseByIdQuery(id); var result = await _mediator.Send(query); return(result == null?NotFound() : (ActionResult)Ok(result)); }