Inject Specific Type With Autofac
问题 I want to inject specific type when some conditions are met. For example, i have got an interface like below. public interface IMyInterface{ } And also two classes that implement this interface public class MyClassA : IMyInterface { } and public class MyClassB : IMyInterface { } Finally i have some service class that gets a constructor parameter as IMyInterface. public class ServiceA{ private IMyInterface _interfaceClass; public ServiceA(IMyInterface interfaceClass){ _interfaceClass =