public Task <List <DataChartResponse> > Handle(GetTicketsUserChartQuery request, CancellationToken cancellationToken) { try { var tickets = _dbContext.Tickets.Count(); return(Task.FromResult(new List <DataChartResponse> { new DataChartResponse { Name = TicketUser.Tickets, Value = tickets } })); } catch (Exception ex) { throw new Exception("There was an error getting the tickets of a user for chart", ex); } }
public async Task <IActionResult> GetTicketsUser([FromQuery] GetTicketsUserChartQuery ticket) { var result = await Mediator.Send(ticket); return(Ok(result)); }