コード例 #1
0
    public async Task <OrderData> GetOrderDraftAsync(BasketData basketData)
    {
        _logger.LogDebug(" grpc client created, basketData={@basketData}", basketData);

        var command  = MapToOrderDraftCommand(basketData);
        var response = await _orderingGrpcClient.CreateOrderDraftFromBasketDataAsync(command);

        _logger.LogDebug(" grpc response: {@response}", response);

        return(MapToResponse(response, basketData));
    }
コード例 #2
0
        public async Task <OrderData> GetOrderDraftAsync(BasketData basketData)
        {
            return(await GrpcCallerService.CallService(_urls.GrpcOrdering, async channel =>
            {
                var client = new OrderingGrpc.OrderingGrpcClient(channel);
                _logger.LogDebug(" grpc client created, basketData={@basketData}", basketData);

                var command = MapToOrderDraftCommand(basketData);
                var response = await client.CreateOrderDraftFromBasketDataAsync(command);
                _logger.LogDebug(" grpc response: {@response}", response);

                return MapToResponse(response, basketData);
            }));
        }