using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.ModelConfiguration; namespace YZXYH.Repository.Models.Mapping { public class MedicalHelpHandleMap : EntityTypeConfiguration { public MedicalHelpHandleMap() { // Primary Key this.HasKey(t => t.Id); // Properties this.Property(t => t.Id) .IsRequired() .HasMaxLength(50); this.Property(t => t.HelpNo) .IsRequired() .HasMaxLength(50); this.Property(t => t.HandleNo) .IsRequired() .HasMaxLength(50); this.Property(t => t.Status) .IsRequired() .IsFixedLength() .HasMaxLength(1); // Table & Column Mappings this.ToTable("MedicalHelpHandle"); this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.HelpNo).HasColumnName("HelpNo"); this.Property(t => t.HandleNo).HasColumnName("HandleNo"); this.Property(t => t.Contents).HasColumnName("Contents"); this.Property(t => t.Status).HasColumnName("Status"); this.Property(t => t.TimeHandle).HasColumnName("TimeHandle"); } } }