Creating HTTP proxies for services
Create a strategy to find the mapped implementation of the interface provided:

IDictionary&lt;Type, Type&gt; mappings; //Populated with all interface to implementation types

private DalServiceBaseClient CreateHttpClient&lt;T&gt;(string baseAddress) {
    var httpClient = new HttpClient {
        BaseAddress = new Uri(baseAddress)
    };
    var implementationType = mappings[typeof(T)];
    if (implementationType == null)
        throw new ArgumentException("No type exists for the provided interface");

    return (DalServiceBaseClient)Activator.CreateInstance(implementationType, httpClient);
}


Note how reflection is used to create an instance of the implementation.

The mappings would be pre-populated and can look like...

mappings = new Dictionary&lt;Type, Type&gt;();
mappings[typeof(IMasterService)] = typeof(MasterServiceClient);
mappings[typeof(ISlaveService)] = typeof(SlaveServiceClient);

//...other types;


Another option if not too keen on using reflection, is to use a factory delegate which would allow a more strongly typed mapping.

IDictionary&lt;Type, Func&lt;HttpClient, DalServiceBaseClient&gt;&gt; mappings; //Populated with all interface to implementation types

private DalServiceBaseClient CreateHttpClient&lt;T&gt;(string baseAddress) {
    var httpClient = new HttpClient {
        BaseAddress = new Uri(baseAddress)
    };
    var implementationFactory = mappings[typeof(T)];
    if (implementationFactory == null)
        throw new ArgumentException("No type exists for the provided interface");

    return implementationFactory(httpClient);
}


Which would be populated like

mappings = new Dictionary&lt;Type, Func&lt;HttpClient, DalServiceBaseClient&gt;&gt;();
mappings[typeof(IMasterService)] = (httpClient) =&gt; new MasterServiceClient(httpClient);
mappings[typeof(ISlaveService)] = (httpClient) =&gt; new SlaveServiceClient(httpClient);

//...other types;