© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
5 replies
Alerin

Microsoft.Data.SqlClient.SqlException (0x80131904) Invalid object name 'Stand.Identity.Role'.

What's wrong here? I do not understand what's going on...
public class Context : DbContext
{
    public DbSet<Models.Role> Role => Set<Models.Role>();
    public DbSet<Models.RolePolicy> RolePolicy => Set<Models.RolePolicy>();
    public DbSet<Models.Roles> Roles => Set<Models.Roles>();
}
public class Context : DbContext
{
    public DbSet<Models.Role> Role => Set<Models.Role>();
    public DbSet<Models.RolePolicy> RolePolicy => Set<Models.RolePolicy>();
    public DbSet<Models.Roles> Roles => Set<Models.Roles>();
}

public class Roles
{
    public int Id { get; set; }
    public User User { get; set; } = null!;
    public Guid UserId { get; set; }
    public Role Role { get; set; } = null!;
    public int RoleId { get; set; }
}
public class Roles
{
    public int Id { get; set; }
    public User User { get; set; } = null!;
    public Guid UserId { get; set; }
    public Role Role { get; set; } = null!;
    public int RoleId { get; set; }
}

public class Role
{
    public int Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public ICollection<RolePolicy> Permission { get; set; } = new List<RolePolicy>();
}
public class Role
{
    public int Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public ICollection<RolePolicy> Permission { get; set; } = new List<RolePolicy>();
}

public class RolePolicy
{
    public int Id { get; set; }
    public Role Role { get; set; } = null!;
    public int RoleId { get; set; }
    public string Policy { get; set; } = string.Empty;
}
public class RolePolicy
{
    public int Id { get; set; }
    public Role Role { get; set; } = null!;
    public int RoleId { get; set; }
    public string Policy { get; set; } = string.Empty;
}


Error: https://pastebin.com/PJhZDHyh
Pastebin
fail: Microsoft.EntityFrameworkCore.Database.Command[20102] Fa...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
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

❔ Microsoft.Data.SqlClient.SqlException
C#CC# / help
3y ago
❔ Error Message: Microsoft.Data.SqlClient.SqlException: 'Incorrect syntax near 'j'.'
C#CC# / help
3y ago
❔ "Invalid object name '...' "
C#CC# / help
3y ago