title: Owin OAuth provider "The entity type IdentityUser is not part of the model for the current context"
body: <pre><code>UserManagerFactory = () =&gt; new UserManager&lt;IdentityUser&gt;(new UserStore&lt;IdentityUser&gt;());
  OAuthOptions = new OAuthAuthorizationServerOptions
  {
      TokenEndpointPath = new PathString("/Token"),
      Provider = new ApplicationOAuthProvider(PublicClientId, UserManagerFactory),
      AuthorizeEndpointPath = new PathString("/api/AccountOwin/ExternalLogin"),
      AccessTokenExpireTimeSpan = TimeSpan.FromDays(14),
      AllowInsecureHttp = true
  };
  </code></pre>
  
  <p>From which IdentityUser,UserStore comesform entity framework.</p>
  
  <p>I want to use my database instead of local db, I generated the "generate" script from the local db tables and
  I created them in my custom database but when I chanhe the db context in the below row:</p>
  
  <pre><code>UserManagerFactory = () =&gt; new UserManager&lt;IdentityUser&gt;(new UserStore&lt;IdentityUser&gt;(new MyCustomDBEntities()));
  </code></pre>
  
  <p>Where MyCustomDBEntities is my custom database in entity framework (edmx)
  I'm getting the  following error:
  "The entity type IdentityUser is not part of the model for the current context"</p>
  
  <p>What I am doing wrong?
  Should I create my own Usermanager?</p>
  
  <pre><code>public class MyCustomDBEntities : IdentityDbContext&lt;IdentityUser&gt;
      {
          public MyCustomDBEntities()
              : base("name=ConnectionStringName")
          {
          }
      }
  </code></pre>