public async Task <OrderGetResult> Get(OrderGetCommand command) { var order = await orderRepository.GetByIdWithItemsAsync(command.Id); if (order == null) { throw new OrderNotFoundException(command.Id, "注文が見つかりませんでした。"); } return(new OrderGetResult(order)); }
public async Task <IActionResult> Get(int orderId) { var command = new OrderGetCommand(orderId); var result = await this._mediator.Send(command); if (result.Status == CommandResultStatus.Success) { return(new OkObjectResult(result.Result)); } return(new BadRequestResult()); }
private async Task init() { var orderGetCommand = new OrderGetCommand(OrderId); var orderGetResult = await orderApplicationService.Get(orderGetCommand); order = orderGetResult.Order; }