static void Main(string[] args) { using (var proxy = new CalculationServiceClient()) { Console.WriteLine(proxy.Add(1, 2)); Console.ReadLine(); } }
static public CalculationServiceClient GetCalculationServiceClient(string serviceUrl) { if (_client == null) { var channel = GrpcChannel.ForAddress(serviceUrl); _client = new CalculationServiceClient(channel); } return(_client); }