UserManagerFactory = () => new UserManager<IdentityUser>(new UserStore<IdentityUser>());
OAuthOptions = new OAuthAuthorizationServerOptions
{
TokenEndpointPath = new PathString("/Token"),
Provider = new ApplicationOAuthProvider(PublicClientId, UserManagerFactory),
AuthorizeEndpointPath = new PathString("/api/AccountOwin/ExternalLogin"),
AccessTokenExpireTimeSpan = TimeSpan.FromDays(14),
AllowInsecureHttp = true
};
From which IdentityUser,UserStore comesform entity framework.
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:
UserManagerFactory = () => new UserManager<IdentityUser>(new UserStore<IdentityUser>(new MyCustomDBEntities()));
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"
What I am doing wrong? Should I create my own Usermanager?
public class MyCustomDBEntities : IdentityDbContext<IdentityUser>
{
public MyCustomDBEntities()
: base("name=ConnectionStringName")
{
}
}