ViewMedicalReplyMap.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class ViewMedicalReplyMap : EntityTypeConfiguration<ViewMedicalReply>
  6. {
  7. public ViewMedicalReplyMap()
  8. {
  9. // Primary Key
  10. this.HasKey(t => new { t.Id, t.ParentId, t.ContentReply, t.TimeReply, t.IsLocked });
  11. // Properties
  12. this.Property(t => t.Id)
  13. .IsRequired()
  14. .HasMaxLength(50);
  15. this.Property(t => t.ParentId)
  16. .IsRequired()
  17. .HasMaxLength(50);
  18. this.Property(t => t.ContentReply)
  19. .IsRequired();
  20. this.Property(t => t.IsLocked)
  21. .IsRequired()
  22. .IsFixedLength()
  23. .HasMaxLength(1);
  24. // Table & Column Mappings
  25. this.ToTable("ViewMedicalReply");
  26. this.Property(t => t.Id).HasColumnName("Id");
  27. this.Property(t => t.ParentId).HasColumnName("ParentId");
  28. this.Property(t => t.ContentReply).HasColumnName("ContentReply");
  29. this.Property(t => t.TimeReply).HasColumnName("TimeReply");
  30. this.Property(t => t.IsLocked).HasColumnName("IsLocked");
  31. }
  32. }
  33. }