public void SetEndpoint(string endpointConfigurationName)
 {
     if (typeof(TServiceInterface).HasAttribute <GeneratedAsyncInterfaceAttribute>())
     {
         Type originalServiceInterfaceType = typeof(TServiceInterface).GetInterfaces()[0];
         channelFactory = ChannelFactoryProvider.GetChannelFactory <TServiceInterface>(endpointConfigurationName, originalServiceInterfaceType);
     }
     else
     {
         channelFactory = ChannelFactoryProvider.GetChannelFactory <TServiceInterface>(endpointConfigurationName);
     }
 }
 public void UseDefaultEndpoint()
 {
     // If TServiceInterface is our generated async interface, the ChannelFactory
     // will look for a config based on the *Async contract. We need to fix this manually.
     if (typeof(TServiceInterface).GetCustomAttribute <GeneratedAsyncInterfaceAttribute>() != null)
     {
         Type originalServiceInterfaceType = typeof(TServiceInterface).GetInterfaces()[0];
         channelFactory = ChannelFactoryProvider.GetChannelFactory <TServiceInterface>(originalServiceInterfaceType);
     }
     else
     {
         channelFactory = ChannelFactoryProvider.GetChannelFactory <TServiceInterface>(typeof(TServiceInterface));
     }
 }
 public void SetEndpoint(ServiceEndpoint endpoint)
 {
     channelFactory = ChannelFactoryProvider.GetChannelFactory <TServiceInterface>(endpoint);
 }
 public void SetEndpoint <TCallback>(Binding binding, EndpointAddress endpointAddress, InstanceContext <TCallback> instanceContext)
 {
     channelFactory = ChannelFactoryProvider.GetChannelFactory <TServiceInterface, TCallback>(binding, endpointAddress, instanceContext);
 }
 public void SetEndpoint(Binding binding, EndpointAddress endpointAddress, object callbackObject)
 {
     channelFactory = ChannelFactoryProvider.GetChannelFactory <TServiceInterface>(binding, endpointAddress, callbackObject);
 }
        /*  public void UseDefaultEndpoint()
         * {
         *    // If TServiceInterface is our generated async interface, the ChannelFactory
         *    // will look for a config based on the *Async contract. We need to fix this manually.
         *    if (typeof(TServiceInterface).GetCustomAttribute<GeneratedAsyncInterfaceAttribute>() != null)
         *    {
         *        Type originalServiceInterfaceType = typeof(TServiceInterface).GetInterfaces()[0];
         *        channelFactory = ChannelFactoryProvider.GetChannelFactory<TServiceInterface>(originalServiceInterfaceType);
         *    }
         *    else
         *    {
         *        channelFactory = ChannelFactoryProvider.GetChannelFactory<TServiceInterface>(typeof(TServiceInterface));
         *    }
         * }*/

        /* public void SetEndpoint(string endpointConfigurationName)
         * {
         *   if (typeof(TServiceInterface).HasAttribute<GeneratedAsyncInterfaceAttribute>())
         *   {
         *       Type originalServiceInterfaceType = typeof(TServiceInterface).GetInterfaces()[0];
         *       channelFactory = ChannelFactoryProvider.GetChannelFactory<TServiceInterface>(endpointConfigurationName, originalServiceInterfaceType);
         *   }
         *   else
         *   {
         *       channelFactory = ChannelFactoryProvider.GetChannelFactory<TServiceInterface>(endpointConfigurationName);
         *   }
         * }*/

        public void SetEndpoint(Binding binding, EndpointAddress endpointAddress)
        {
            channelFactory = ChannelFactoryProvider.GetChannelFactory <TServiceInterface>(binding, endpointAddress);
        }
 public void SetEndpoint <TCallback>(ServiceEndpoint endpoint, InstanceContext <TCallback> instanceContext)
 {
     channelFactory = ChannelFactoryProvider.GetChannelFactory <TServiceInterface, TCallback>(endpoint, instanceContext);
 }
 public void SetEndpoint(ServiceEndpoint endpoint, object callbackObject)
 {
     channelFactory = ChannelFactoryProvider.GetChannelFactory <TServiceInterface>(endpoint, callbackObject);
 }