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); }
public async Task <OrderDto> Get(int id) { return(await _orderQueryService.GetAsync(id)); }
public async Task <OrderDto> Handle(GetOrderQueryModel request, CancellationToken cancellationToken) => await orderQueryService.GetAsync(request.Id);