Exemplo n.º 1
0
        protected virtual ChannelCreator CreateChannelCreator(Type contract, M clientModel, IChannelBuilderScope scope, params object[] channelFactoryArgs)
        {
            var type           = typeof(ChannelFactory <>).MakeGenericType(new[] { contract });
            var channelFactory = ChannelFactoryBuilder.CreateChannelFactory(type, clientModel, channelFactoryArgs);

            scope.ConfigureChannelFactory(channelFactory);

            var methodInfo = type.GetMethod("CreateChannel", Type.EmptyTypes);

            return((ChannelCreator)Delegate.CreateDelegate(typeof(ChannelCreator), channelFactory, methodInfo));
        }