mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-17 19:37:45 +08:00
34 lines
994 B
C#
34 lines
994 B
C#
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");
|
|
}
|
|
}
|
|
}
|