Parameterized Factories Using Ninject
问题 How to make Ninject to instantiate object based on variable on run time?. I am trying to inject the correct Repository in The Controller action - MVC 3 - based on parameter come from user input. If user input "BMW" it would bind ICarRepository to BMWRepository , and if he input "KIA" KiaRepository will be injected. [HttpPost] public ActionResult SearchResult(FormCollection values) { string carModel = values["model"]; ICarRepository myRepository = RepositoryFactory.getRepository(carModel); ...