public TServiceInterface CreateServiceProxy <TServiceInterface>(Uri serviceUri, ServicePartitionKey partitionKey = null, TargetReplicaSelector targetReplicaSelector = TargetReplicaSelector.Default, string listenerName = null)
            where TServiceInterface : IService
        {
            TServiceInterface proxy = serviceProxyFactory.CreateServiceProxy <TServiceInterface>(serviceUri, partitionKey, targetReplicaSelector, listenerName);

            methodNameProvider.AddMethodsForProxyOrService(proxy.GetType().GetInterfaces(), typeof(IService));
            return(proxy);
        }
示例#2
0
        public CorrelatingRemotingMessageHandler(ServiceContext serviceContext, IService service)
        {
            this.serviceContext = serviceContext;

            // Populate our method name provider with methods from the IService interfaces
            methodNameProvider = new MethodNameProvider(false /* threadSafe */);
            methodNameProvider.AddMethodsForProxyOrService(service.GetType().GetInterfaces(), typeof(IService));

            innerHandler = new ServiceRemotingDispatcher(serviceContext, service);
        }