mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 01:58:01 +08:00
Routine Update
This commit is contained in:
@@ -4,21 +4,20 @@ using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class PageElementGrantMap : EntityTypeConfiguration<PageElementGrant>
|
||||
public class ModuleElementGrantMap : EntityTypeConfiguration<ModuleElementGrant>
|
||||
{
|
||||
public PageElementGrantMap()
|
||||
public ModuleElementGrantMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.Id);
|
||||
|
||||
// Properties
|
||||
// Table & Column Mappings
|
||||
this.ToTable("PageElementGrant");
|
||||
this.ToTable("ModuleElementGrant");
|
||||
this.Property(t => t.Id).HasColumnName("Id");
|
||||
this.Property(t => t.ElementId).HasColumnName("ElementId");
|
||||
this.Property(t => t.UserId).HasColumnName("UserId");
|
||||
this.Property(t => t.RoleId).HasColumnName("RoleId");
|
||||
this.Property(t => t.PostId).HasColumnName("PostId");
|
||||
this.Property(t => t.GrantType).HasColumnName("GrantType");
|
||||
}
|
||||
}
|
@@ -4,9 +4,9 @@ using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class PageElementMap : EntityTypeConfiguration<PageElement>
|
||||
public class ModuleElementMap : EntityTypeConfiguration<ModuleElement>
|
||||
{
|
||||
public PageElementMap()
|
||||
public ModuleElementMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.Id);
|
||||
@@ -25,13 +25,12 @@ namespace OpenAuth.Repository.Models.Mapping
|
||||
.HasMaxLength(4000);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("PageElement");
|
||||
this.ToTable("ModuleElement");
|
||||
this.Property(t => t.Id).HasColumnName("Id");
|
||||
this.Property(t => t.DomId).HasColumnName("DomId");
|
||||
this.Property(t => t.Name).HasColumnName("Name");
|
||||
this.Property(t => t.Type).HasColumnName("Type");
|
||||
this.Property(t => t.ModuleId).HasColumnName("ModuleId");
|
||||
this.Property(t => t.PageId).HasColumnName("PageId");
|
||||
this.Property(t => t.Remark).HasColumnName("Remark");
|
||||
}
|
||||
}
|
@@ -1,50 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Entity.ModelConfiguration;
|
||||
using OpenAuth.Domain;
|
||||
|
||||
namespace OpenAuth.Repository.Models.Mapping
|
||||
{
|
||||
public class PageMap : EntityTypeConfiguration<Page>
|
||||
{
|
||||
public PageMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.Id);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.Name)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.Url)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.Icon)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.IconBig)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.Vector)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("Page");
|
||||
this.Property(t => t.Id).HasColumnName("Id");
|
||||
this.Property(t => t.ModuleId).HasColumnName("ModuleId");
|
||||
this.Property(t => t.Name).HasColumnName("Name");
|
||||
this.Property(t => t.Url).HasColumnName("Url");
|
||||
this.Property(t => t.Type).HasColumnName("Type");
|
||||
this.Property(t => t.Enabled).HasColumnName("Enabled");
|
||||
this.Property(t => t.IsDefault).HasColumnName("IsDefault");
|
||||
this.Property(t => t.Icon).HasColumnName("Icon");
|
||||
this.Property(t => t.IconBig).HasColumnName("IconBig");
|
||||
this.Property(t => t.Vector).HasColumnName("Vector");
|
||||
this.Property(t => t.SortNo).HasColumnName("SortNo");
|
||||
}
|
||||
}
|
||||
}
|
@@ -18,11 +18,10 @@ namespace OpenAuth.Repository.Models
|
||||
}
|
||||
|
||||
public DbSet<Module> Modules { get; set; }
|
||||
public DbSet<ModuleElement> ModuleElements { get; set; }
|
||||
public DbSet<ModuleElementGrant> ModuleElementGrants { get; set; }
|
||||
public DbSet<ModuleRole> ModuleRoles { get; set; }
|
||||
public DbSet<Org> Orgs { get; set; }
|
||||
public DbSet<Page> Pages { get; set; }
|
||||
public DbSet<PageElement> PageElements { get; set; }
|
||||
public DbSet<PageElementGrant> PageElementGrants { get; set; }
|
||||
public DbSet<Role> Roles { get; set; }
|
||||
public DbSet<User> Users { get; set; }
|
||||
public DbSet<UserCfg> UserCfgs { get; set; }
|
||||
@@ -34,11 +33,10 @@ namespace OpenAuth.Repository.Models
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Configurations.Add(new ModuleMap());
|
||||
modelBuilder.Configurations.Add(new ModuleElementMap());
|
||||
modelBuilder.Configurations.Add(new ModuleElementGrantMap());
|
||||
modelBuilder.Configurations.Add(new ModuleRoleMap());
|
||||
modelBuilder.Configurations.Add(new OrgMap());
|
||||
modelBuilder.Configurations.Add(new PageMap());
|
||||
modelBuilder.Configurations.Add(new PageElementMap());
|
||||
modelBuilder.Configurations.Add(new PageElementGrantMap());
|
||||
modelBuilder.Configurations.Add(new RoleMap());
|
||||
modelBuilder.Configurations.Add(new UserMap());
|
||||
modelBuilder.Configurations.Add(new UserCfgMap());
|
||||
|
Reference in New Issue
Block a user