public async Task <CatalogItem> GetCatalogItemAsync(int id) { return(await GrpcCallerService.CallService(_urls.Catalog + UrlsConfig.CatalogOperations.GetItemById(id), async channel => { var client = new CatalogClient(channel); var request = new CatalogItemRequest { Id = id }; var response = await client.GetItemByIdAsync(request); return MapToCatalogItemResponse(response); })); }
public async Task <CatalogItem> GetCatalogItemAsync(int id) { return(await GrpcCallerService.CallService(_urls.GrpcCatalog, async channel => { var client = new CatalogClient(channel); var request = new CatalogItemRequest { Id = id }; _logger.LogInformation("grpc client created, request = {@request}", request); var response = await client.GetItemByIdAsync(request); _logger.LogInformation("grpc response {@response}", response); return MapToCatalogItemResponse(response); })); }