public async Task <OrderDto> Handle(GetOrderQueryModel request, CancellationToken cancellationToken)
        {
            var orderDto = await orderQueryService.GetAsync(request.Id);

            if (request.UserType == UserType.Admin || orderDto.User.Id == request.UserId)
            {
                return(orderDto);
            }

            throw new StreetwoodException(ErrorCode.NoAccess);
        }
示例#2
0
 public async Task <OrderDto> Get(int id)
 {
     return(await _orderQueryService.GetAsync(id));
 }
示例#3
0
 public async Task <OrderDto> Handle(GetOrderQueryModel request, CancellationToken cancellationToken)
 => await orderQueryService.GetAsync(request.Id);