コード例 #1
0
        public void BeforeAll()
        {
            _host = new ServerHost();

            _host.Services.AddServiceModelSingleton <IMultipurposeService>(new MultipurposeService());
            DomainService = new ClientFactory().CreateClient <IMultipurposeService>(_host.Channel);

            _host.Start();
        }
コード例 #2
0
        public void BeforeAll()
        {
            _host = new ServerHost();

            _host.Services.AddServiceModelSingleton <IConcreteContract1>(new ConcreteContract1());
            _host.Services.AddServiceModelSingleton(new ConcreteContract2());
            DomainService1 = new ClientFactory().CreateClient <IConcreteContract1>(_host.Channel);
            DomainService2 = new ClientFactory().CreateClient <IConcreteContract2>(_host.Channel);

            _host.Start();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        public void BeforeAll()
        {
            _host = new ServerHost();

            _host.Services.AddServiceModelSingleton(
                new TrackedFilteredService(),
                options =>
            {
                options.ServiceProvider = new Mock <IServiceProvider>().Object;
                options.Filters.Add(1, _ => new MockServerFilter());
            });
            DomainService = new ClientFactory().CreateClient <IFilteredService>(_host.Channel);

            _host.Start();
        }
コード例 #5
0
        public void BeforeAll()
        {
            _host = new ServerHost(ChannelType);

            _host.Services.AddServiceModelSingleton(
                new ErrorService(),
                options =>
            {
                options.ErrorHandler = new ServerErrorHandler();
            });

            DomainService = new ClientFactory(new ServiceModelGrpcClientOptions {
                ErrorHandler = new ClientErrorHandler()
            })
                            .CreateClient <IErrorService>(_host.Channel.CreateCallInvoker());

            _host.Start();
        }