Esempio n. 1
0
        public async Task <ActionResult <IEnumerable <OrderDto> > > Get(string username)
        {
            var u = new GetOrderByUserName(username);
            var o = await _mediator.Send(u);

            return(Ok(o));
        }
Esempio n. 2
0
        public async Task <IEnumerable <OrderDto> > Handle(GetOrderByUserName request, CancellationToken cancellationToken)
        {
            var orders = await _repository.GetOrderByUserNameAsync(request.UserName);

            return(MapperObject.Mapper.Map <IEnumerable <OrderDto> >(orders));
        }