Shadow Prop Error with IdentityDbContext
This is my IdentityDbContext:
public class ApplicationUser : IdentityUser
{
[Required(ErrorMessage = "First name is required")]
[Display(Name = "First Name")]
[MaxLength(50)]
public string FirstName { get; set; }
[Required(ErrorMessage = "Last name is required")]
[Display(Name = "Last Name")]
[MaxLength(50)]
public string LastName { get; set; }
public virtual ICollection<ApplicationUserClaim> Claims { get; set; }
public virtual ICollection<IdentityUserLogin<string>> Logins { get; set; }
public virtual ICollection<IdentityUserToken<string>> Tokens { get; set; }
}
public class ApplicationRole : IdentityRole
{
}
public class ApplicationUserRole : IdentityUserRole<string>
{
public bool IsReadOnly { get; set; }
public string ProgramId { get; set; }
public bool IsDefault { get; set; }
public virtual TestProgram Program { get; set; }
}
public class ApplicationRoleClaim : IdentityRoleClaim<string>
{
public virtual ApplicationRole Role { get; set; }
}
public class ApplicationUserClaim : IdentityUserClaim<string>
{
public virtual ApplicationUser User { get; set; }
}
I keep getting weird errors, especially when using the Login page, where it includes extra userid columns in the query, e.g. "UserId1". Any idea how to fix? I've been researching for quite a while and would love a hint in the right direction. Please let me know any additional information that would be needed. Also, I do have "base.OnModelCreating(modelBuilder);" in my dbcontext OnModelCreating method.
0 Replies