C#
C#

help

Root Question Message

Alerin
Alerin9/21/2022
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 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 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
Alerin
Alerin9/21/2022
Alerin
Alerin9/21/2022
refresh
Message Not Public

Sign In and Join Server To See

9/21/2022
Message Not Public

Sign In and Join Server To See

9/21/2022
Alerin
Alerin9/21/2022
the base is empty, I think "Role" is a name collision. I have to change.
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy