I\'m using Identity which has his own context.
public class ApplicationUser : IdentityUser {
// some custom fields
}
public class IdentityContext : Identity
Example:
public class ApplicationUser : IdentityUser {
// some custom fields
}
public class Comment{
public int Id {get;set;}
public string Message{get;set;}
public DateTime Time{get;set;}
public string AuthorId {get;set}
[ForeignKey("AuthorId")]
public virtual ApplicationUser Author {get;set;}
}
public class MyContext :IdentityDbContext {
public MyContext(): base("DefaultConnection", false){ }
public DbSet Comments { get; set; }
//... other DbSets
}
I always flow this pattern. Hopefully it's help you.