2015-04-15 23:57:36 +08:00
|
|
|
using System.Data.Entity.ModelConfiguration;
|
|
|
|
using OpenAuth.Domain;
|
|
|
|
|
2015-09-20 21:59:36 +08:00
|
|
|
namespace OpenAuth.Repository.Models.Mapping
|
2015-04-15 23:57:36 +08:00
|
|
|
{
|
|
|
|
public class RoleMap : EntityTypeConfiguration<Role>
|
|
|
|
{
|
|
|
|
public RoleMap()
|
|
|
|
{
|
|
|
|
// Primary Key
|
2015-09-20 21:59:36 +08:00
|
|
|
this.HasKey(t => t.RoleId);
|
2015-04-15 23:57:36 +08:00
|
|
|
|
|
|
|
// Properties
|
2015-09-20 21:59:36 +08:00
|
|
|
this.Property(t => t.RoleId)
|
2015-04-15 23:57:36 +08:00
|
|
|
.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)
|
2015-09-20 21:59:36 +08:00
|
|
|
.HasMaxLength(50);
|
2015-04-15 23:57:36 +08:00
|
|
|
|
|
|
|
this.Property(t => t.DepartmentId)
|
|
|
|
.HasMaxLength(50);
|
|
|
|
|
|
|
|
// Table & Column Mappings
|
|
|
|
this.ToTable("Role");
|
2015-09-20 21:59:36 +08:00
|
|
|
this.Property(t => t.RoleId).HasColumnName("RoleId");
|
2015-04-15 23:57:36 +08:00
|
|
|
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");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|