/// <summary>Invokes a method on the channel.</summary> /// <param name="action">The action to perform.</param> protected virtual void InvokeMethod(Action <T> action) { if (HasOpenChannel) { action(m_channel.Client); } else { ServiceClientFactory.InvokeMethod <T>(action, CreateInstance); } }
/// <summary>Invokes a method on the channel.</summary> /// <typeparam name="TResult">The type of the result.</typeparam> /// <param name="action">The action to perform.</param> protected virtual TResult InvokeMethod <TResult> (Func <T, TResult> action) { return(HasOpenChannel ? action(m_channel.Client) : ServiceClientFactory.InvokeMethod <T, TResult>(action, CreateInstance)); }
/// <summary>Creates an instance of the client wrapper.</summary> /// <returns>The client wrapper.</returns> protected virtual ServiceClientWrapper <T> CreateInstance() { return(ServiceClientFactory.CreateAndWrap <T>()); }