public IActionResult TryConnectingTogrpc() { var g = new Models.HomeGrpcViewModel() { GrpcUrl = appSettings.Value.BusinessUrl, Greeting = "" }; return(View(g)); }
public IActionResult TryConnectingTogrpc(Models.HomeGrpcViewModel model) { using var channel = Grpc.Net.Client.GrpcChannel.ForAddress(model.GrpcUrl); var client = new Greeter.GreeterClient(channel); var hr = new HelloRequest { Name = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name }; var reply = client.SayHello(hr); model.Greeting = reply.Message; return(View(model)); }