public async Task <ActionResult <ListResponse <BudgetPeriodListDto> > > GetById([FromRoute] BudgetPeriodQuery query)
        {
            //TODO Necessary, Or Call base controller, Or exception middleware
            if (query == null || query.Id < 1)
            {
                return(new NotFoundResult());
            }

            var result = await Mediator.Send(query);

            return(result == null?NotFound() : Ok(result));
        }
Exemple #2
0
 public async Task <DataResponse <DataResponse <DataResponse <BudgetPeriodDto> > > > Handle(BudgetPeriodQuery request, CancellationToken cancellationToken)
 {
     return(_mapper.Map <DataResponse <DataResponse <DataResponse <BudgetPeriodDto> > > >(await _repository.GetEntityAsync(request.Id, cancellationToken)));
 }