title: constructor parameters on controller actions
body: <p>I am trying to create a custom manager which is passed in the controller when it is being called and I am having troubles understanding the current implementation of new MVC5 project in c#.</p>
  
  <p>Here is the default implementation:</p>
  
  <pre><code>public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager )
  {
      UserManager = userManager;
      SignInManager = signInManager;
  }
  </code></pre>
  
  <p>above all of that are declarations for them:</p>
  
  <pre><code>public ApplicationSignInManager SignInManager
  {
      get
      {
          return _signInManager ?? HttpContext.GetOwinContext().Get&lt;ApplicationSignInManager&gt;();
      }
      private set 
      { 
          _signInManager = value; 
      }
  }
  
  public ApplicationUserManager UserManager
  {
      get
      {
          return _userManager ?? HttpContext.GetOwinContext().GetUserManager&lt;ApplicationUserManager&gt;();
      }
      private set
      {
          _userManager = value;
      }
  }
  </code></pre>
  
  <p>Now from my understanding the SignInManager and UserManager get created when application gets created for the first time in Startup.Auth.cs which looks like this:</p>
  
  <pre><code>app.CreatePerOwinContext&lt;ApplicationUserManager&gt;(ApplicationUserManager.Create);
  app.CreatePerOwinContext&lt;ApplicationSignInManager&gt;(ApplicationSignInManager.Create);
  </code></pre>
  
  <p>So now whenever I call UserManager I will get that first instance that was created when project ran for the first time.</p>
  
  <p>I have 2 questions.  Question 1 is is anything I said above wrong and Do I have a wrong understanding of how MVC5 works?</p>
  
  <p>Question2:  How is UserManager and SignInManager generated and passed in the controller?  Where is the code that creates that first instance of the manager and passes it in the controller?  I am assuming it is <code>app.CreatePerOwnContext that does it</code>.  If so, can I then just create my own Manager and then register it with Owin in the same fashion and reuse throughout the project?  Will my code get the latest data from the database if I do this and not cache it?</p>