title: Multiple controller constructors when injecting dependencies using Unity.Mvc5
body: <p>I'm very new to dependency injection and I've just set up Unity.Mvc5 and has some success with it. But now I face the problem of multiple contructors in my controller class. I already have constructors that handle my <code>UserManager</code> and following tutorials I understand I need another constructor to instantiate my interface. When I do this however, I get the following error:</p>
  
  <blockquote>
    <p>The type OrganisationController has multiple constructors of length 1. Unable to disambiguate.</p>
  </blockquote>
  
  <p>A snippet from my controller:</p>
  
  <pre><code>    private IPush _pushMessage;
  
      // Here is the problem!
      public OrganisationController(IPush pushMessage)
      {
          _pushMessage = pushMessage;
      }
  
      public OrganisationController()
          : this(new UserManager&lt;ApplicationUser&gt;(new UserStore&lt;ApplicationUser&gt;(new ApplicationDbContext())))
      {
      }
  
      public OrganisationController(UserManager&lt;ApplicationUser&gt; userManager)
      {
          UserManager = userManager;
          var provider = new DpapiDataProtectionProvider("MyApp");
          UserManager.UserTokenProvider = new DataProtectorTokenProvider&lt;ApplicationUser&gt;(provider.Create("PasswordReset"));
      }
  
      public UserManager&lt;ApplicationUser&gt; UserManager { get; private set; }
  </code></pre>
  
  <p>And my <code>UnityConfig.cs</code> as follows:</p>
  
  <pre><code>public static class UnityConfig
  {
      public static void RegisterComponents()
      {
          var container = new UnityContainer();
  
          container.RegisterType&lt;IPush, PushMessage&gt;();
          container.RegisterType&lt;IController, OrganisationController&gt;();
          container.RegisterType&lt;IUserStore&lt;ApplicationUser&gt;, UserStore&lt;ApplicationUser&gt;&gt;();
          container.RegisterType&lt;DbContext, ApplicationDbContext&gt;(new HierarchicalLifetimeManager());
  
          DependencyResolver.SetResolver(new UnityDependencyResolver(container));
      }
  }
  </code></pre>
  
  <p>I am not sure how to tell Unity that I have another constructor being used to implement an interface.</p>