[ApiController] [Route("[controller]")] public class GreetingController : ControllerBase { private ILoggerFactory _loggerFactory; public GreetingController(ILoggerFactory loggerFactory) { _loggerFactory = loggerFactory; } [HttpGet] public async Task> Get(string name) { var channel = GrpcChannel.ForAddress("https://localhost:5001", new GrpcChannelOptions { LoggerFactory = _loggerFactory }); var client = new Greeter.GreeterClient(channel); var reply = await client.SayHelloAsync(new HelloRequest { Name = name }); return Ok(reply.Message); } }