示例#1
0
 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);
     });
 }
示例#2
0
 public CommentsApi(CommentService.CommentServiceClient client)
 {
     this.client = client;
 }