© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago
Lamp

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.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Vertical Slice Architecture and adding IdentityDbContext<TUser>
C#CC# / help
2y ago
Do I add my Models in the IdentityDbContext from the template?
C#CC# / help
2y ago
Shadow Effect in WPF
C#CC# / help
4y ago
Shadow property, but property is defined?
C#CC# / help
3y ago