예제 #1
0
        public override async Task <FizzReply> Fizzify(FizzId request, ServerCallContext context)
        {
            await Task.Delay(50);

            return(new FizzReply
            {
                Fizzable = request.Id % 3 == 0
            });
        }
예제 #2
0
        public async Task <FizzModel> Get(int id)
        {
            using var fizzChannel = GrpcChannel.ForAddress(_channelUrl);
            var fizzClient = new Fizz.FizzClient(fizzChannel);

            var request = new FizzId {
                Id = id
            };

            var reply = await fizzClient.FizzifyAsync(request);

            return(new FizzModel
            {
                Id = id,
                Fizzable = reply.Fizzable
            });
        }