private ServerServiceDefinition CreateServiceDefinition()
        {
            var definitionBuilder = ServerServiceDefinition.CreateBuilder();
            var endpointBinder    = GetOrCreateEndpointBinder();

            var binder = new SelfHostServiceMethodBinder <TService>(
                (_options?.MarshallerFactory).ThisOrDefault(),
                _serviceFactory,
                definitionBuilder);

            endpointBinder.Bind(binder);

            return(definitionBuilder.Build());
        }
Beispiel #2
0
        private ServerServiceDefinition CreateServiceDefinition()
        {
            var definitionBuilder = ServerServiceDefinition.CreateBuilder();
            var endpointBinder    = GetOrCreateEndpointBinder();

            // SelfHostBinder must check ServiceProvider availability
            var filterRegistration = new ServiceMethodFilterRegistration(_options?.ServiceProvider !);

            filterRegistration.Add(_options?.GetFilters());

            var binder = new SelfHostServiceMethodBinder <TService>(
                (_options?.MarshallerFactory).ThisOrDefault(),
                WithLoggerFactory <TService> .Wrap(_serviceFactory, _options?.Logger),
                filterRegistration,
                definitionBuilder);

            endpointBinder.Bind(binder);

            return(definitionBuilder.Build());
        }