Esempio n. 1
0
 public ClientCallsFactory(Func <ChannelBase> channelFactory)
 {
     _channelFactory = channelFactory;
     _clientOptions  = new ServiceModelGrpcClientOptions
     {
         MarshallerFactory = DemoMarshallerFactory.Default
     };
 }
Esempio n. 2
0
        public KestrelHost ConfigureClientFactory(Action <ServiceModelGrpcClientOptions> configuration)
        {
            var options = new ServiceModelGrpcClientOptions();

            configuration(options);
            _clientFactoryDefaultOptions = options;
            return(this);
        }
        public void BeforeAll()
        {
            _host = new ServerHost();

            _host.Services.AddServiceModelSingleton(new HeadersService());

            var options = new ServiceModelGrpcClientOptions {
                DefaultCallOptionsFactory = () => new CallOptions(DefaultMetadata)
            };

            DomainService = new ClientFactory(options).CreateClient <IHeadersService>(_host.Channel);

            _host.Start();
        }