I'm trying to put Asp.net identity context to a class library that provides data access using entity framework edmx.
But it gives an error such; The entity type ApplicationUser is not part of the model for the current context.
Here is db context class;
- public class ApplicationUser : IdentityUser
- {
- public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
- {
-
- var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
-
- return userIdentity;
- }
- }
-
- public partial class AppDbContext : IdentityDbContext<ApplicationUser>
- {
- public AppDbContext ()
- : base("name=AppDbContext")
- {
- }
-
- public static AppDbContext Create()
- {
- return new AppDbContext();
- }
-
- protected override void OnModelCreating(DbModelBuilder modelBuilder)
- {
- throw new UnintentionalCodeFirstException();
- }
-
-
-
-
-
-
- }