I'm following this great answer for Conditional Resolving in Dependency Inject by @NightOwl888
He used to register the Dependency Injections using Code like below
// Note that the strings used here for instance names have nothing
// to do with the strings used to select the instance in the strategy pattern
unityContainer.RegisterType<IAuthenticate, TwitterAuth>("twitterAuth");
unityContainer.RegisterType<IAuthenticate, FacebookAuth>("facebookAuth");
unityContainer.RegisterType<IAuthenticateStrategy, AuthenticateStrategy>(
new InjectionConstructor(
new ResolvedArrayParameter<IAuthenticate>(
new ResolvedParameter<IAuthenticate>("twitterAuth")
),
new ResolvedArrayParameter<IAuthenticate>(
new ResolvedParameter<IAuthenticate>("facebookAuth")
)
));
But I'd like to implement the above through web.config
. So that my change would be just a configuration and not code changes
So far I can able to get only simple implementation like here