feat: 配置实体

This commit is contained in:
zhangpeihang 2022-01-26 15:40:33 +08:00
parent 889f03189d
commit 58c4d6d5b2
1 changed files with 7 additions and 3 deletions

View File

@ -30,18 +30,22 @@ public static class EntityConfiguration
builder.Entity<User>().Ignore(u => u.IsReset);
builder.Entity<User>().Property(s => s.Id).HasConversion(converter).ValueGeneratedOnAdd();
builder.Entity<UserRole>().Property(s => s.Id).HasConversion(converter).ValueGeneratedOnAdd();
builder.Entity<Role>().ToTable("Roles");
builder.Entity<Role>().Property(s => s.Id).HasConversion(converter).ValueGeneratedOnAdd();
builder.Entity<Navigation>().ToTable("Navigations");
builder.Entity<Navigation>().Property(s => s.Id).HasConversion(converter).ValueGeneratedOnAdd();
builder.Entity<Navigation>().Property(s => s.Id).HasConversion(converter!).ValueGeneratedOnAdd();
builder.Entity<Navigation>().Ignore(s => s.HasChildren);
builder.Entity<Dict>().ToTable("Dicts");
builder.Entity<Dict>().Property(s => s.Id).HasConversion(converter).ValueGeneratedOnAdd();
builder.Entity<Group>().ToTable("Groups");
builder.Entity<Group>().Property(s => s.Id).HasConversion(converter).ValueGeneratedOnAdd();
builder.Entity<Error>().ToTable("Exceptions");
builder.Entity<LoginLog>().ToTable("LoginLogs");
builder.Entity<Trace>().ToTable("Traces");
}
}