public async ValueTask <IResolveResult> GetRatingAsync(ResolverContext context)
        {
            var input  = context.GetArgument <GetRatingByProductIdRequest>("input");
            var result = await _ratingServiceClient.GetRatingByProductIdAsync(input);

            return(As(result.Rating));
        }
Beispiel #2
0
        public async Task <IActionResult> Get(Guid productId)
        {
            var result = await _serviceClient.GetRatingByProductIdAsync(
                new GetRatingByProductIdRequest { ProductId = productId.ToString() });

            return(Ok(result));
        }
 public async ValueTask <IResolveResult> GetRatingAsync(ResolverContext context)
 {
     return(await GrpcClientCatch(
                "rating-service",
                async headers =>
     {
         var input = context.GetArgument <GetRatingByProductIdRequest>("input");
         var result = await _ratingServiceClient.GetRatingByProductIdAsync(input, headers);
         return As(result.Rating);
     }));
 }