title: Lazy Dependency Injection
body: <p>I have a project where the Ninject is used as IoC container. My concern is that a lot of classes have such kind of constructors:</p>
  
  <pre><code>[Inject]
  public HomeController(
      UserManager userManager, RoleManager roleManager, BlahblahManager blahblahManager) {
     _userManager = userManager;
     _roleManager = roleManager;
     _blahblahManager = blahblahManager;
  }
  </code></pre>
  
  <p>What if I don't want to have all instances of these classes at once?</p>
  
  <p>The way, when all this classes are wrapped by <code>Lazy&lt;T&gt;</code> and passed to constructor is not exactly what I need. The <code>T</code> instances are not created yet, but <code>Lazy&lt;T&gt;</code> instances are already stored in memory.</p>
  
  <p>My colleague is suggesting me to use Factory pattern to have control over all instantiations, but I'm not sure that IoC have such great design bug.</p>
  
  <p>Is there a workaround for this situation or IoC really have such big defect in it's design? Maybe I should use another IoC container? </p>
  
  <p>Any suggestions?</p>