mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-11-08 18:34:44 +08:00
complete login
This commit is contained in:
@@ -37,6 +37,25 @@ namespace OpenAuth.Infrastructure.Mapping
|
||||
this.Property(t => t.Target)
|
||||
.HasMaxLength(50);
|
||||
|
||||
//<2F>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>İ<EFBFBD>ť
|
||||
this.HasMany(t => t.Buttons)
|
||||
.WithMany(b => b.Menus)
|
||||
.Map(m =>
|
||||
{
|
||||
m.MapLeftKey("MenuId");
|
||||
m.MapRightKey("ButtonId");
|
||||
m.ToTable("MenuButton");
|
||||
});
|
||||
//TODO:<3A>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣬EF<45><46>ѯʱ<D1AF><CAB1><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>Role_RoleId<49><64>
|
||||
this.HasMany(t => t.Roles)
|
||||
.WithMany(b => b.RoleMenus)
|
||||
.Map(m =>
|
||||
{
|
||||
m.MapLeftKey("MenuId");
|
||||
m.MapRightKey("RoleId");
|
||||
m.ToTable("RoleMenu");
|
||||
});
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("Menu");
|
||||
this.Property(t => t.MenuId).HasColumnName("MenuId");
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace OpenAuth.Infrastructure.Mapping
|
||||
this.Property(t => t.DepartmentId)
|
||||
.HasMaxLength(50);
|
||||
|
||||
//<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>
|
||||
this.HasMany(d => d.Users)
|
||||
.WithMany(u => u.Roles)
|
||||
.Map(
|
||||
@@ -41,6 +42,16 @@ namespace OpenAuth.Infrastructure.Mapping
|
||||
m.ToTable("UserRole");
|
||||
});
|
||||
|
||||
//<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD>IJ˵<C4B2>
|
||||
this.HasMany(m => m.RoleMenus)
|
||||
.WithMany(r => r.Roles)
|
||||
.Map(m =>
|
||||
{
|
||||
m.MapLeftKey("RoleId");
|
||||
m.MapRightKey("MenuId");
|
||||
m.ToTable("RoleMenu");
|
||||
});
|
||||
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("Role");
|
||||
|
||||
@@ -37,8 +37,10 @@
|
||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net40\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Activities" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenAuth.Infrastructure
|
||||
public DbSet<Department> Departments { get; set; }
|
||||
public DbSet<Menu> Menus { get; set; }
|
||||
public DbSet<Role> Roles { get; set; }
|
||||
public DbSet<RoleMenuButton> RoleMenuButtons { get; set; }
|
||||
// public DbSet<RoleMenuButton> RoleMenuButtons { get; set; }
|
||||
public DbSet<User> Users { get; set; }
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
@@ -32,7 +32,7 @@ namespace OpenAuth.Infrastructure
|
||||
modelBuilder.Configurations.Add(new DepartmentMap());
|
||||
modelBuilder.Configurations.Add(new MenuMap());
|
||||
modelBuilder.Configurations.Add(new RoleMap());
|
||||
modelBuilder.Configurations.Add(new RoleMenuButtonMap());
|
||||
// modelBuilder.Configurations.Add(new RoleMenuButtonMap());
|
||||
modelBuilder.Configurations.Add(new UserMap());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user