public static void AddGrpcClient(this IServiceCollection services, string address) { services.AddSingleton(s => { AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); var channel = GrpcChannel.ForAddress(address); var client = new CommentService.CommentServiceClient(channel); return(client); }); }
public CommentsApi(CommentService.CommentServiceClient client) { this.client = client; }