title: Successfully implementing custom UserManager<IUser> in Identity 2.0
body: <p>I'm trying to navigate the black hole that is the custom implementation of Identity Membership.  My goal right now is simply to get this line from my <code>ApiController</code> to correctly retrieve my UserManager:</p>
  
  <pre><code>public IHttpActionResult Index()
  {
      var manager = HttpContext.Current.GetOwinContext().GetUserManager&lt;UserManager&lt;MyUser,int&gt;&gt;();
      //manager is null
  }
  </code></pre>
  
  <p>Here's my setup.  In my <code>Startup</code>'s Configuration I set up the WebApi and add my OwinContext:</p>
  
  <pre><code>app.CreatePerOwinContext&lt;UserManager&lt;MyUser,int&gt;&gt;(Create);
  </code></pre>
  
  <p>My Create method:</p>
  
  <pre><code>public static UserManager&lt;User,int&gt; Create(IdentityFactoryOptions&lt;UserManager&lt;MyUser,int&gt;&gt; options, IOwinContext context)
  {
     return new UserManager&lt;MyUser,int&gt;(new UserStore(new DbContext()));
  }
  </code></pre>
  
  <p>the rest is the most basic implementation I can make.  </p>
  
  <p>MyUser:</p>
  
  <pre><code>public class MyUser : IUser&lt;int&gt;
  {
      public int Id { get; set; }
      public string UserName { get; set; }
  }
  </code></pre>
  
  <p>MyUserStore:</p>
  
  <pre><code> public class MyUserStore : IUserStore&lt;MyUser,int&gt;
   {
      private IdentityDbContext context;
      public MyUserStore(IdentityDbContext c)
      {
         context = c;
      }
  
      //Create,Delete, etc implementations
   }
  </code></pre>
  
  <p>MyDbContext:</p>
  
  <pre><code> public class MyDbContext : IdentityDbContext
   {
       public MyDbContext() : base("Conn")
       {
  
       }
   }
  </code></pre>
  
  <p>This is all for the sake of learning how Identity works, which I'm pretty convinced no one actually knows.  I want to be able to fully customize my Users and Roles eventually, avoiding Microsoft's IdentityUser.  </p>
  
  <p>Again, my issue right now is that in my controller, I am getting <code>null</code> when trying to retrieve my UserManager.</p>
  
  <p>Any and all help is greatly appreciated.</p>