protected override IEnumerable <ServiceReplicaListener> CreateServiceReplicaListeners()
        {
            Type[] ifaces = typeof(TServiceImplementation).GetAllInterfaces()
                            .Where(iface => iface.IsAssignableTo <IService>())
                            .ToArray();
            if (ifaces.Length == 0)
            {
                return(Enumerable.Empty <ServiceReplicaListener>());
            }

            return(new[]
            {
                new ServiceReplicaListener(
                    context => ServiceHostRemoting.CreateServiceRemotingListener <TServiceImplementation>(
                        context,
                        ifaces,
                        _container))
            });
        }
Exemple #2
0
        protected override IEnumerable <ServiceReplicaListener> CreateServiceReplicaListeners()
        {
            if (_container == null)
            {
                throw new InvalidOperationException("CreateServiceReplicaListeners called before OnOpenAsync");
            }

            Type[] interfaces = typeof(TServiceImplementation).GetAllInterfaces()
                                .Where(iface => iface.IsAssignableTo <IService>())
                                .ToArray();
            if (interfaces.Length == 0)
            {
                return(Enumerable.Empty <ServiceReplicaListener>());
            }

            return(new[]
            {
                new ServiceReplicaListener(
                    context => ServiceHostRemoting.CreateServiceRemotingListener <TServiceImplementation>(
                        context,
                        interfaces,
                        _container))
            });
        }