using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.ModelConfiguration; namespace YZXYH.Repository.Models.Mapping { public class ViewMedicalReplyMap : EntityTypeConfiguration { public ViewMedicalReplyMap() { // Primary Key this.HasKey(t => new { t.Id, t.ParentId, t.ContentReply, t.TimeReply, t.IsLocked }); // Properties this.Property(t => t.Id) .IsRequired() .HasMaxLength(50); this.Property(t => t.ParentId) .IsRequired() .HasMaxLength(50); this.Property(t => t.ContentReply) .IsRequired(); this.Property(t => t.IsLocked) .IsRequired() .IsFixedLength() .HasMaxLength(1); // Table & Column Mappings this.ToTable("ViewMedicalReply"); this.Property(t => t.Id).HasColumnName("Id"); this.Property(t => t.ParentId).HasColumnName("ParentId"); this.Property(t => t.ContentReply).HasColumnName("ContentReply"); this.Property(t => t.TimeReply).HasColumnName("TimeReply"); this.Property(t => t.IsLocked).HasColumnName("IsLocked"); } } }