采用全新的数据库架构

This commit is contained in:
yubaolee
2015-10-26 21:58:12 +08:00
parent 366d3a5351
commit 13d44f28b6
91 changed files with 21208 additions and 9430 deletions

View File

@@ -1,49 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class ButtonMap : EntityTypeConfiguration<Button>
{
public ButtonMap()
{
// Primary Key
this.HasKey(t => t.ButtonId);
// Properties
this.Property(t => t.ButtonId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.FullName)
.HasMaxLength(50);
this.Property(t => t.Img)
.HasMaxLength(50);
this.Property(t => t.Event)
.HasMaxLength(50);
this.Property(t => t.Control_ID)
.HasMaxLength(50);
this.Property(t => t.Category)
.HasMaxLength(50);
this.Property(t => t.Description)
.HasMaxLength(50);
// Table & Column Mappings
this.ToTable("Button");
this.Property(t => t.ButtonId).HasColumnName("ButtonId");
this.Property(t => t.FullName).HasColumnName("FullName");
this.Property(t => t.Img).HasColumnName("Img");
this.Property(t => t.Event).HasColumnName("Event");
this.Property(t => t.Control_ID).HasColumnName("Control_ID");
this.Property(t => t.Category).HasColumnName("Category");
this.Property(t => t.Description).HasColumnName("Description");
this.Property(t => t.Enabled).HasColumnName("Enabled");
this.Property(t => t.SortCode).HasColumnName("SortCode");
}
}
}

View File

@@ -1,33 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class DataPermissionMap : EntityTypeConfiguration<DataPermission>
{
public DataPermissionMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.RoleId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.ResourceId)
.HasMaxLength(50);
// Table & Column Mappings
this.ToTable("DataPermission");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.RoleId).HasColumnName("RoleId");
this.Property(t => t.ResourceId).HasColumnName("ResourceId");
this.Property(t => t.ObjectId).HasColumnName("ObjectId");
}
}
}

View File

@@ -1,38 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class DepartmentMap : EntityTypeConfiguration<Department>
{
public DepartmentMap()
{
// Primary Key
this.HasKey(t => t.DepartmentId);
// Properties
this.Property(t => t.DepartmentId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.ParentId)
.HasMaxLength(50);
this.Property(t => t.FullName)
.HasMaxLength(50);
this.Property(t => t.Description)
.HasMaxLength(50);
// Table & Column Mappings
this.ToTable("Department");
this.Property(t => t.DepartmentId).HasColumnName("DepartmentId");
this.Property(t => t.ParentId).HasColumnName("ParentId");
this.Property(t => t.FullName).HasColumnName("FullName");
this.Property(t => t.Description).HasColumnName("Description");
this.Property(t => t.Enabled).HasColumnName("Enabled");
this.Property(t => t.SortCode).HasColumnName("SortCode");
this.Property(t => t.DeleteMark).HasColumnName("DeleteMark");
}
}
}

View File

@@ -1,33 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class MenuButtonMap : EntityTypeConfiguration<MenuButton>
{
public MenuButtonMap()
{
// Primary Key
this.HasKey(t => t.MenuButtonId);
// Properties
this.Property(t => t.MenuButtonId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.MenuId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.ButtonId)
.IsRequired()
.HasMaxLength(50);
// Table & Column Mappings
this.ToTable("MenuButton");
this.Property(t => t.MenuButtonId).HasColumnName("MenuButtonId");
this.Property(t => t.MenuId).HasColumnName("MenuId");
this.Property(t => t.ButtonId).HasColumnName("ButtonId");
}
}
}

View File

@@ -1,55 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class MenuMap : EntityTypeConfiguration<Menu>
{
public MenuMap()
{
// Primary Key
this.HasKey(t => t.MenuId);
// Properties
this.Property(t => t.MenuId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.ParentId)
.HasMaxLength(50);
this.Property(t => t.FullName)
.HasMaxLength(50);
this.Property(t => t.Description)
.HasMaxLength(50);
this.Property(t => t.Img)
.HasMaxLength(50);
this.Property(t => t.NavigateUrl)
.HasMaxLength(200);
this.Property(t => t.FormName)
.HasMaxLength(200);
this.Property(t => t.Target)
.HasMaxLength(50);
// Table & Column Mappings
this.ToTable("Menu");
this.Property(t => t.MenuId).HasColumnName("MenuId");
this.Property(t => t.ParentId).HasColumnName("ParentId");
this.Property(t => t.FullName).HasColumnName("FullName");
this.Property(t => t.Description).HasColumnName("Description");
this.Property(t => t.Img).HasColumnName("Img");
this.Property(t => t.Category).HasColumnName("Category");
this.Property(t => t.NavigateUrl).HasColumnName("NavigateUrl");
this.Property(t => t.FormName).HasColumnName("FormName");
this.Property(t => t.Target).HasColumnName("Target");
this.Property(t => t.IsUnfold).HasColumnName("IsUnfold");
this.Property(t => t.Enabled).HasColumnName("Enabled");
this.Property(t => t.SortCode).HasColumnName("SortCode");
}
}
}

View File

@@ -0,0 +1,60 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class ModuleMap : EntityTypeConfiguration<Module>
{
public ModuleMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.CascadeId)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Name)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Url)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.HotKey)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.IconName)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.ParentName)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Vector)
.IsRequired()
.HasMaxLength(255);
// Table & Column Mappings
this.ToTable("Module");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.CascadeId).HasColumnName("CascadeId");
this.Property(t => t.Name).HasColumnName("Name");
this.Property(t => t.Url).HasColumnName("Url");
this.Property(t => t.HotKey).HasColumnName("HotKey");
this.Property(t => t.ParentId).HasColumnName("ParentId");
this.Property(t => t.IsLeaf).HasColumnName("IsLeaf");
this.Property(t => t.IsAutoExpand).HasColumnName("IsAutoExpand");
this.Property(t => t.IconName).HasColumnName("IconName");
this.Property(t => t.Status).HasColumnName("Status");
this.Property(t => t.ParentName).HasColumnName("ParentName");
this.Property(t => t.Vector).HasColumnName("Vector");
this.Property(t => t.SortNo).HasColumnName("SortNo");
}
}
}

View File

@@ -0,0 +1,28 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class ModuleRoleMap : EntityTypeConfiguration<ModuleRole>
{
public ModuleRoleMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
// Table & Column Mappings
this.ToTable("ModuleRole");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.RoleId).HasColumnName("RoleId");
this.Property(t => t.ModuleId).HasColumnName("ModuleId");
this.Property(t => t.Type).HasColumnName("Type");
this.Property(t => t.OperateTime).HasColumnName("OperateTime");
this.Property(t => t.OperatorId).HasColumnName("OperatorId");
}
}
}

View File

@@ -0,0 +1,63 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class OrgMap : EntityTypeConfiguration<Org>
{
public OrgMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.CascadeId)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Name)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.HotKey)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.ParentName)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.IconName)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.BizCode)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.CustomCode)
.IsRequired()
.HasMaxLength(4000);
// Table & Column Mappings
this.ToTable("Org");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.CascadeId).HasColumnName("CascadeId");
this.Property(t => t.Name).HasColumnName("Name");
this.Property(t => t.HotKey).HasColumnName("HotKey");
this.Property(t => t.ParentId).HasColumnName("ParentId");
this.Property(t => t.ParentName).HasColumnName("ParentName");
this.Property(t => t.IsLeaf).HasColumnName("IsLeaf");
this.Property(t => t.IsAutoExpand).HasColumnName("IsAutoExpand");
this.Property(t => t.IconName).HasColumnName("IconName");
this.Property(t => t.Status).HasColumnName("Status");
this.Property(t => t.Type).HasColumnName("Type");
this.Property(t => t.BizCode).HasColumnName("BizCode");
this.Property(t => t.CustomCode).HasColumnName("CustomCode");
this.Property(t => t.CreateTime).HasColumnName("CreateTime");
this.Property(t => t.CreateId).HasColumnName("CreateId");
this.Property(t => t.SortNo).HasColumnName("SortNo");
}
}
}

View File

@@ -0,0 +1,28 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class PageElementGrantMap : EntityTypeConfiguration<PageElementGrant>
{
public PageElementGrantMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
// Table & Column Mappings
this.ToTable("PageElementGrant");
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");
}
}
}

View File

@@ -0,0 +1,40 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class PageElementMap : EntityTypeConfiguration<PageElement>
{
public PageElementMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
this.Property(t => t.DomId)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Name)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Remark)
.IsRequired()
.HasMaxLength(4000);
// Table & Column Mappings
this.ToTable("PageElement");
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.Remark).HasColumnName("Remark");
}
}
}

View File

@@ -0,0 +1,50 @@
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");
}
}
}

View File

@@ -1,46 +1,39 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class RoleMap : EntityTypeConfiguration<Role>
{
public RoleMap()
{
// Primary Key
this.HasKey(t => t.RoleId);
// Properties
this.Property(t => t.RoleId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.ParentId)
.HasMaxLength(50);
this.Property(t => t.FullName)
.HasMaxLength(50);
this.Property(t => t.Category)
.HasMaxLength(50);
this.Property(t => t.Description)
.HasMaxLength(50);
this.Property(t => t.DepartmentId)
.HasMaxLength(50);
// Table & Column Mappings
this.ToTable("Role");
this.Property(t => t.RoleId).HasColumnName("RoleId");
this.Property(t => t.ParentId).HasColumnName("ParentId");
this.Property(t => t.FullName).HasColumnName("FullName");
this.Property(t => t.Category).HasColumnName("Category");
this.Property(t => t.Description).HasColumnName("Description");
this.Property(t => t.Enabled).HasColumnName("Enabled");
this.Property(t => t.SortCode).HasColumnName("SortCode");
this.Property(t => t.DeleteMark).HasColumnName("DeleteMark");
this.Property(t => t.DepartmentId).HasColumnName("DepartmentId");
}
}
}
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class RoleMap : EntityTypeConfiguration<Role>
{
public RoleMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Name)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.CreateId)
.IsRequired()
.HasMaxLength(64);
this.Property(t => t.CreateOrgCascadeId)
.IsRequired()
.HasMaxLength(255);
// Table & Column Mappings
this.ToTable("Role");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.Name).HasColumnName("Name");
this.Property(t => t.Status).HasColumnName("Status");
this.Property(t => t.Type).HasColumnName("Type");
this.Property(t => t.CreateTime).HasColumnName("CreateTime");
this.Property(t => t.CreateId).HasColumnName("CreateId");
this.Property(t => t.CreateOrgId).HasColumnName("CreateOrgId");
this.Property(t => t.CreateOrgCascadeId).HasColumnName("CreateOrgCascadeId");
}
}
}

View File

@@ -1,38 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class RoleMenuButtonMap : EntityTypeConfiguration<RoleMenuButton>
{
public RoleMenuButtonMap()
{
// Primary Key
this.HasKey(t => t.RoleMenuButtonId);
// Properties
this.Property(t => t.RoleMenuButtonId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.RoleId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.MenuId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.ButtonId)
.IsRequired()
.HasMaxLength(50);
// Table & Column Mappings
this.ToTable("RoleMenuButton");
this.Property(t => t.RoleMenuButtonId).HasColumnName("RoleMenuButtonId");
this.Property(t => t.RoleId).HasColumnName("RoleId");
this.Property(t => t.MenuId).HasColumnName("MenuId");
this.Property(t => t.ButtonId).HasColumnName("ButtonId");
}
}
}

View File

@@ -1,33 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class RoleMenuMap : EntityTypeConfiguration<RoleMenu>
{
public RoleMenuMap()
{
// Primary Key
this.HasKey(t => t.RoleMenuId);
// Properties
this.Property(t => t.RoleMenuId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.RoleId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.MenuId)
.IsRequired()
.HasMaxLength(50);
// Table & Column Mappings
this.ToTable("RoleMenu");
this.Property(t => t.RoleMenuId).HasColumnName("RoleMenuId");
this.Property(t => t.RoleId).HasColumnName("RoleId");
this.Property(t => t.MenuId).HasColumnName("MenuId");
}
}
}

View File

@@ -0,0 +1,44 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class UserCfgMap : EntityTypeConfiguration<UserCfg>
{
public UserCfgMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
this.Property(t => t.Theme)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Skin)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.NavBarStyle)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.TabFocusColor)
.IsRequired()
.HasMaxLength(255);
// Table & Column Mappings
this.ToTable("UserCfg");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.Theme).HasColumnName("Theme");
this.Property(t => t.Skin).HasColumnName("Skin");
this.Property(t => t.NavBarStyle).HasColumnName("NavBarStyle");
this.Property(t => t.TabFocusColor).HasColumnName("TabFocusColor");
this.Property(t => t.NavTabIndex).HasColumnName("NavTabIndex");
}
}
}

View File

@@ -1,33 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class UserDepartmentMap : EntityTypeConfiguration<UserDepartment>
{
public UserDepartmentMap()
{
// Primary Key
this.HasKey(t => t.UserDepartmentId);
// Properties
this.Property(t => t.UserDepartmentId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.DepartmentId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.UserId)
.IsRequired()
.HasMaxLength(50);
// Table & Column Mappings
this.ToTable("UserDepartment");
this.Property(t => t.UserDepartmentId).HasColumnName("UserDepartmentId");
this.Property(t => t.DepartmentId).HasColumnName("DepartmentId");
this.Property(t => t.UserId).HasColumnName("UserId");
}
}
}

View File

@@ -0,0 +1,89 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class UserExtMap : EntityTypeConfiguration<UserExt>
{
public UserExtMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
this.Property(t => t.Email)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Phone_)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Mobile)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Address)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Zip)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Birthday)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.IdCard)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.QQ)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.DynamicField)
.IsRequired()
.HasMaxLength(4000);
this.Property(t => t.Remark)
.IsRequired()
.HasMaxLength(4000);
this.Property(t => t.Field1)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Field2)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Field3)
.IsRequired()
.HasMaxLength(255);
// Table & Column Mappings
this.ToTable("UserExt");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.Email).HasColumnName("Email");
this.Property(t => t.Phone_).HasColumnName("Phone_");
this.Property(t => t.Mobile).HasColumnName("Mobile");
this.Property(t => t.Address).HasColumnName("Address");
this.Property(t => t.Zip).HasColumnName("Zip");
this.Property(t => t.Birthday).HasColumnName("Birthday");
this.Property(t => t.IdCard).HasColumnName("IdCard");
this.Property(t => t.QQ).HasColumnName("QQ");
this.Property(t => t.DynamicField).HasColumnName("DynamicField");
this.Property(t => t.ByteArrayId).HasColumnName("ByteArrayId");
this.Property(t => t.Remark).HasColumnName("Remark");
this.Property(t => t.Field1).HasColumnName("Field1");
this.Property(t => t.Field2).HasColumnName("Field2");
this.Property(t => t.Field3).HasColumnName("Field3");
}
}
}

View File

@@ -1,41 +1,48 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class UserMap : EntityTypeConfiguration<User>
{
public UserMap()
{
// Primary Key
this.HasKey(t => t.UserId);
// Properties
this.Property(t => t.UserId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.Account)
.HasMaxLength(50);
this.Property(t => t.Password)
.HasMaxLength(50);
this.Property(t => t.RealName)
.HasMaxLength(50);
this.Property(t => t.RoleId)
.HasMaxLength(50);
// Table & Column Mappings
this.ToTable("User");
this.Property(t => t.UserId).HasColumnName("UserId");
this.Property(t => t.Account).HasColumnName("Account");
this.Property(t => t.Password).HasColumnName("Password");
this.Property(t => t.RealName).HasColumnName("RealName");
this.Property(t => t.RoleId).HasColumnName("RoleId");
this.Property(t => t.Enabled).HasColumnName("Enabled");
this.Property(t => t.DeleteMark).HasColumnName("DeleteMark");
}
}
}
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class UserMap : EntityTypeConfiguration<User>
{
public UserMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
this.Property(t => t.Account)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Password)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.Name)
.IsRequired()
.HasMaxLength(255);
this.Property(t => t.BizCode)
.IsRequired()
.HasMaxLength(255);
// Table & Column Mappings
this.ToTable("User");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.Account).HasColumnName("Account");
this.Property(t => t.Password).HasColumnName("Password");
this.Property(t => t.Name).HasColumnName("Name");
this.Property(t => t.Sex).HasColumnName("Sex");
this.Property(t => t.Status).HasColumnName("Status");
this.Property(t => t.Type).HasColumnName("Type");
this.Property(t => t.BizCode).HasColumnName("BizCode");
this.Property(t => t.CreateTime).HasColumnName("CreateTime");
this.Property(t => t.CreateId).HasColumnName("CreateId");
}
}
}

View File

@@ -0,0 +1,28 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class UserModuleMap : EntityTypeConfiguration<UserModule>
{
public UserModuleMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
// Table & Column Mappings
this.ToTable("UserModule");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.UserId).HasColumnName("UserId");
this.Property(t => t.ModuleId).HasColumnName("ModuleId");
this.Property(t => t.Type).HasColumnName("Type");
this.Property(t => t.OperateTime).HasColumnName("OperateTime");
this.Property(t => t.OperatorId).HasColumnName("OperatorId");
}
}
}

View File

@@ -0,0 +1,27 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class UserOrgMap : EntityTypeConfiguration<UserOrg>
{
public UserOrgMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
// Table & Column Mappings
this.ToTable("UserOrg");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.OrgId).HasColumnName("OrgId");
this.Property(t => t.UserId).HasColumnName("UserId");
this.Property(t => t.OperateTime).HasColumnName("OperateTime");
this.Property(t => t.OperatorId).HasColumnName("OperatorId");
}
}
}

View File

@@ -1,33 +1,27 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class UserRoleMap : EntityTypeConfiguration<UserRole>
{
public UserRoleMap()
{
// Primary Key
this.HasKey(t => t.UserRoleId);
// Properties
this.Property(t => t.UserRoleId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.UserId)
.IsRequired()
.HasMaxLength(50);
this.Property(t => t.RoleId)
.IsRequired()
.HasMaxLength(50);
// Table & Column Mappings
this.ToTable("UserRole");
this.Property(t => t.UserRoleId).HasColumnName("UserRoleId");
this.Property(t => t.UserId).HasColumnName("UserId");
this.Property(t => t.RoleId).HasColumnName("RoleId");
}
}
}
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class UserRoleMap : EntityTypeConfiguration<UserRole>
{
public UserRoleMap()
{
// Primary Key
this.HasKey(t => t.Id);
// Properties
this.Property(t => t.Id)
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
// Table & Column Mappings
this.ToTable("UserRole");
this.Property(t => t.Id).HasColumnName("Id");
this.Property(t => t.RoleId).HasColumnName("RoleId");
this.Property(t => t.UserId).HasColumnName("UserId");
this.Property(t => t.OperateTime).HasColumnName("OperateTime");
this.Property(t => t.OperatorId).HasColumnName("OperatorId");
}
}
}

View File

@@ -1,27 +0,0 @@
using System.Data.Entity.ModelConfiguration;
using OpenAuth.Domain;
namespace OpenAuth.Repository.Models.Mapping
{
public class sysdiagramMap : EntityTypeConfiguration<sysdiagram>
{
public sysdiagramMap()
{
// Primary Key
this.HasKey(t => t.diagram_id);
// Properties
this.Property(t => t.name)
.IsRequired()
.HasMaxLength(128);
// Table & Column Mappings
this.ToTable("sysdiagrams");
this.Property(t => t.name).HasColumnName("name");
this.Property(t => t.principal_id).HasColumnName("principal_id");
this.Property(t => t.diagram_id).HasColumnName("diagram_id");
this.Property(t => t.version).HasColumnName("version");
this.Property(t => t.definition).HasColumnName("definition");
}
}
}

View File

@@ -1,48 +1,51 @@
using System.Data.Entity;
using OpenAuth.Domain;
using OpenAuth.Repository.Models.Mapping;
namespace OpenAuth.Repository.Models
{
public partial class OpenAuthDBContext : DbContext
{
static OpenAuthDBContext()
{
Database.SetInitializer<OpenAuthDBContext>(null);
}
public OpenAuthDBContext()
: base("Name=OpenAuthDBContext")
{
}
public DbSet<Button> Buttons { get; set; }
public DbSet<DataPermission> DataPermissions { get; set; }
public DbSet<Department> Departments { get; set; }
public DbSet<Menu> Menus { get; set; }
public DbSet<MenuButton> MenuButtons { get; set; }
public DbSet<Role> Roles { get; set; }
public DbSet<RoleMenu> RoleMenus { get; set; }
public DbSet<RoleMenuButton> RoleMenuButtons { get; set; }
public DbSet<sysdiagram> sysdiagrams { get; set; }
public DbSet<User> Users { get; set; }
public DbSet<UserDepartment> UserDepartments { get; set; }
public DbSet<UserRole> UserRoles { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Configurations.Add(new ButtonMap());
modelBuilder.Configurations.Add(new DataPermissionMap());
modelBuilder.Configurations.Add(new DepartmentMap());
modelBuilder.Configurations.Add(new MenuMap());
modelBuilder.Configurations.Add(new MenuButtonMap());
modelBuilder.Configurations.Add(new RoleMap());
modelBuilder.Configurations.Add(new RoleMenuMap());
modelBuilder.Configurations.Add(new RoleMenuButtonMap());
modelBuilder.Configurations.Add(new sysdiagramMap());
modelBuilder.Configurations.Add(new UserMap());
modelBuilder.Configurations.Add(new UserDepartmentMap());
modelBuilder.Configurations.Add(new UserRoleMap());
}
}
}
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using OpenAuth.Domain;
using OpenAuth.Repository.Models.Mapping;
namespace OpenAuth.Repository.Models
{
public partial class OpenAuthDBContext : DbContext
{
static OpenAuthDBContext()
{
Database.SetInitializer<OpenAuthDBContext>(null);
}
public OpenAuthDBContext()
: base("Name=OpenAuthDBContext")
{
}
public DbSet<Module> Modules { 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; }
public DbSet<UserExt> UserExts { get; set; }
public DbSet<UserModule> UserModules { get; set; }
public DbSet<UserOrg> UserOrgs { get; set; }
public DbSet<UserRole> UserRoles { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Configurations.Add(new ModuleMap());
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());
modelBuilder.Configurations.Add(new UserExtMap());
modelBuilder.Configurations.Add(new UserModuleMap());
modelBuilder.Configurations.Add(new UserOrgMap());
modelBuilder.Configurations.Add(new UserRoleMap());
}
}
}