public async Task OnGet() { PresentOrdersRequest request = new PresentOrdersRequest(); List <Order> orders = await mediator.Send(request); Orders = orders .Select(x => new OrderViewModel(x)) .ToList(); }
public Task <List <Order> > Handle(PresentOrdersRequest request, CancellationToken cancellationToken) { return(Task.Run(() => unitOfWork.OrderRepository.GetAllFull(), cancellationToken)); }