示例#1
0
        public static async Task GetEmployeeById(int id)
        {
            using var channel = GrpcChannel.ForAddress("https://localhost:5001");
            var client   = new EmployeeService.EmployeeServiceClient(channel);
            var employee = await client.GetByIdAsync(new GetByIdRequest
            {
                Id = id
            });

            Console.WriteLine($"Response messages: {employee}");
        }