using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.ModelConfiguration; namespace YZXYH.Repository.Models.Mapping { public class IndustryInfoMap : EntityTypeConfiguration { public IndustryInfoMap() { // Primary Key this.HasKey(t => t.Id); // Properties this.Property(t => t.Id) .IsRequired() .HasMaxLength(50); this.Property(t => t.IndustryName) .IsRequired() .HasMaxLength(50); this.Property(t => t.IndustryType) .IsRequired() .HasMaxLength(50); this.Property(t => t.SortNo) .IsFixedLength() .HasMaxLength(4); this.Property(t => t.IsLocked) .IsRequired() .IsFixedLength() .HasMaxLength(1); // Table & Column Mappings this.ToTable("IndustryInfos"); this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.IndustryName).HasColumnName("IndustryName"); this.Property(t => t.IndustryType).HasColumnName("IndustryType"); this.Property(t => t.SortNo).HasColumnName("SortNo"); this.Property(t => t.IsLocked).HasColumnName("IsLocked"); this.Property(t => t.Remark).HasColumnName("Remark"); } } }