Esempio n. 1
0
        public override async Task <GrpcResponses> GetCustomersWithClientStream(IAsyncStreamReader <GrpcRequest> requestStream,
                                                                                ServerCallContext context)
        {
            var response = new GrpcResponses();

            while (await requestStream.MoveNext(CancellationToken.None))
            {
                response.Response.Add(new GrpcResponse
                {
                    Value = requestStream.Current.Value
                });
            }

            return(response);
        }
Esempio n. 2
0
        public override async Task <GrpcResponses> GetCustomers(GrpcRequests request, ServerCallContext context)
        {
            Console.WriteLine("GetCustomers Server Received ");

            var response = new GrpcResponses();

            foreach (var grpcRequest in request.Request)
            {
                response.Response.Add(new GrpcResponse
                {
                    Value = grpcRequest.Value
                });
            }

            return(await Task.FromResult(response));
        }