using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.ModelConfiguration; namespace YZXYH.Repository.Models.Mapping { public class SysFunctionMap : EntityTypeConfiguration { public SysFunctionMap() { // Primary Key this.HasKey(t => t.Id); // Properties this.Property(t => t.Id) .IsRequired() .HasMaxLength(50); this.Property(t => t.FunctionName) .IsRequired() .HasMaxLength(50); this.Property(t => t.FatherID) .IsRequired() .HasMaxLength(50); this.Property(t => t.ActionName) .HasMaxLength(150); this.Property(t => t.ControllerName) .HasMaxLength(150); this.Property(t => t.URL) .HasMaxLength(500); this.Property(t => t.IsLeaf) .IsRequired() .IsFixedLength() .HasMaxLength(1); this.Property(t => t.Path) .IsRequired() .HasMaxLength(500); this.Property(t => t.IsFront) .IsRequired() .IsFixedLength() .HasMaxLength(1); this.Property(t => t.IsBack) .IsRequired() .IsFixedLength() .HasMaxLength(1); this.Property(t => t.IsBrowse) .IsRequired() .IsFixedLength() .HasMaxLength(1); this.Property(t => t.IsAdd) .IsRequired() .IsFixedLength() .HasMaxLength(1); this.Property(t => t.IsUpdate) .IsRequired() .IsFixedLength() .HasMaxLength(1); this.Property(t => t.IsDelete) .IsRequired() .IsFixedLength() .HasMaxLength(1); this.Property(t => t.IsAudit) .IsRequired() .IsFixedLength() .HasMaxLength(1); this.Property(t => t.IsPrint) .IsRequired() .IsFixedLength() .HasMaxLength(1); this.Property(t => t.UserIDLastMod) .HasMaxLength(30); this.Property(t => t.PageName) .HasMaxLength(300); // Table & Column Mappings this.ToTable("SysFunctions"); this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.FunctionName).HasColumnName("FunctionName"); this.Property(t => t.FatherID).HasColumnName("FatherID"); this.Property(t => t.ActionName).HasColumnName("ActionName"); this.Property(t => t.ControllerName).HasColumnName("ControllerName"); this.Property(t => t.URL).HasColumnName("URL"); this.Property(t => t.Depth).HasColumnName("Depth"); this.Property(t => t.IsLeaf).HasColumnName("IsLeaf"); this.Property(t => t.Sort).HasColumnName("Sort"); this.Property(t => t.Path).HasColumnName("Path"); this.Property(t => t.IsFront).HasColumnName("IsFront"); this.Property(t => t.IsBack).HasColumnName("IsBack"); this.Property(t => t.IsBrowse).HasColumnName("IsBrowse"); this.Property(t => t.IsAdd).HasColumnName("IsAdd"); this.Property(t => t.IsUpdate).HasColumnName("IsUpdate"); this.Property(t => t.IsDelete).HasColumnName("IsDelete"); this.Property(t => t.IsAudit).HasColumnName("IsAudit"); this.Property(t => t.IsPrint).HasColumnName("IsPrint"); this.Property(t => t.TimeCreated).HasColumnName("TimeCreated"); this.Property(t => t.TimeLastMod).HasColumnName("TimeLastMod"); this.Property(t => t.UserIDLastMod).HasColumnName("UserIDLastMod"); this.Property(t => t.PageName).HasColumnName("PageName"); } } }