mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-21 02:57:54 +08:00
添加资源表/数据字典/分类
This commit is contained in:
44
OpenAuth.Repository/Models/Mapping/ResourceMap.cs
Normal file
44
OpenAuth.Repository/Models/Mapping/ResourceMap.cs
Normal 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 ResourceMap : EntityTypeConfiguration<Resource>
|
||||
{
|
||||
public ResourceMap()
|
||||
{
|
||||
// Primary Key
|
||||
this.HasKey(t => t.Id);
|
||||
|
||||
// Properties
|
||||
this.Property(t => t.CascadeId)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.Key)
|
||||
.IsRequired()
|
||||
.HasMaxLength(200);
|
||||
|
||||
this.Property(t => t.Name)
|
||||
.IsRequired()
|
||||
.HasMaxLength(255);
|
||||
|
||||
this.Property(t => t.Description)
|
||||
.IsRequired()
|
||||
.HasMaxLength(500);
|
||||
|
||||
// Table & Column Mappings
|
||||
this.ToTable("Resource");
|
||||
this.Property(t => t.Id).HasColumnName("Id");
|
||||
this.Property(t => t.CascadeId).HasColumnName("CascadeId");
|
||||
this.Property(t => t.Key).HasColumnName("Key");
|
||||
this.Property(t => t.Name).HasColumnName("Name");
|
||||
this.Property(t => t.ParentId).HasColumnName("ParentId");
|
||||
this.Property(t => t.Status).HasColumnName("Status");
|
||||
this.Property(t => t.SortNo).HasColumnName("SortNo");
|
||||
this.Property(t => t.CategoryId).HasColumnName("CategoryId");
|
||||
this.Property(t => t.Description).HasColumnName("Description");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user