Abstract Factory and Inversion of Control resolve at runtime
问题 I have the following class and interface structure and I'm having a hard time trying to get the code to do what I need. public interface IUserManager { int Add(User user); } public class UserManagerA : IUserManager{} public class UserManagerB : IUserManager{} In this example I'm using Ninject as the IoC container but I'm open to changing it if some other container resolves the issue: This is inside my NinjectWebCommon.cs : void RegisterServices(IKernel kernel) { string userRole = CurrentUser