Hello,
I have following wrapper to help me manage the wcf client lifetime:
public class ServiceProxyHelper<TProxy, TChannel> : IDisposable
where TProxy : ClientBase<TChannel>, new()
where TChannel : class
{
private TProxy m_proxy;
public TProxy Proxy
{
get
{
if (m_proxy != null)
{
return m_proxy;
}
throw new ObjectDisposedException("ServiceProxyHelper");
}
}
protected ServiceProxyHelper()
{
m_proxy = new TProxy();
}
public void Dispose()
{
//....
}
}
I'm using that in the following way:
public class AccountServiceClientWrapper : ServiceProxyHelper<AccountServiceClient, IAccountService>
{
}
public class Test()
{
using(AccountServiceClientWrapper wrapper = new AccountServiceClientWrapper())
{
wrapper.Proxy.Authenticate();
}
}
How I can modify that code to provide endpointConfigurationName for the client ?
wrapper.Proxy.Endpoint.Name = "MyCustomEndpointName";
Is not working. That endpointConfigurationName should be provider to service client constructor, but how I can do that using this wrapper ?
Regards