MedicalHelpMap.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class MedicalHelpMap : EntityTypeConfiguration<MedicalHelp>
  6. {
  7. public MedicalHelpMap()
  8. {
  9. // Primary Key
  10. this.HasKey(t => t.Id);
  11. // Properties
  12. this.Property(t => t.Id)
  13. .IsRequired()
  14. .HasMaxLength(50);
  15. this.Property(t => t.UserNoApply)
  16. .IsRequired()
  17. .HasMaxLength(50);
  18. this.Property(t => t.Title)
  19. .IsRequired();
  20. this.Property(t => t.ContentApply)
  21. .IsRequired();
  22. this.Property(t => t.Status)
  23. .IsRequired()
  24. .IsFixedLength()
  25. .HasMaxLength(1);
  26. this.Property(t => t.ContactNoApply)
  27. .HasMaxLength(50);
  28. this.Property(t => t.RelationshipApply)
  29. .HasMaxLength(50);
  30. this.Property(t => t.IsLocked)
  31. .IsRequired()
  32. .IsFixedLength()
  33. .HasMaxLength(1);
  34. this.Property(t => t.AttachFileNo)
  35. .HasMaxLength(50);
  36. // Table & Column Mappings
  37. this.ToTable("MedicalHelp");
  38. this.Property(t => t.Id).HasColumnName("Id");
  39. this.Property(t => t.UserNoApply).HasColumnName("UserNoApply");
  40. this.Property(t => t.Title).HasColumnName("Title");
  41. this.Property(t => t.ContentApply).HasColumnName("ContentApply");
  42. this.Property(t => t.Status).HasColumnName("Status");
  43. this.Property(t => t.ContactNoApply).HasColumnName("ContactNoApply");
  44. this.Property(t => t.RelationshipApply).HasColumnName("RelationshipApply");
  45. this.Property(t => t.UserNoReply).HasColumnName("UserNoReply");
  46. this.Property(t => t.ContentReply).HasColumnName("ContentReply");
  47. this.Property(t => t.TimeApply).HasColumnName("TimeApply");
  48. this.Property(t => t.TimeReply).HasColumnName("TimeReply");
  49. this.Property(t => t.TimeEnd).HasColumnName("TimeEnd");
  50. this.Property(t => t.IsLocked).HasColumnName("IsLocked");
  51. this.Property(t => t.AttachFileNo).HasColumnName("AttachFileNo");
  52. }
  53. }
  54. }