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