AlumUsersBackupMap.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class AlumUsersBackUpMap : EntityTypeConfiguration<AlumUsersBackUp>
  6. {
  7. public AlumUsersBackUpMap()
  8. {
  9. // Primary Key
  10. this.HasKey(t => new { t.Id, t.Mobile, t.Password, t.Name, t.Gender, t.Email, t.Birthday, t.CityNo, t.GraduationYear, t.ContactAddress, t.Workunit, t.IsAudited, t.IsPublic, t.IsLocked, t.Vip, t.TimeCreate });
  11. // Properties
  12. this.Property(t => t.Id)
  13. .IsRequired()
  14. .HasMaxLength(50);
  15. this.Property(t => t.Mobile)
  16. .IsRequired()
  17. .HasMaxLength(15);
  18. this.Property(t => t.Password)
  19. .IsRequired()
  20. .HasMaxLength(18);
  21. this.Property(t => t.Name)
  22. .IsRequired()
  23. .HasMaxLength(50);
  24. this.Property(t => t.NickName)
  25. .HasMaxLength(50);
  26. this.Property(t => t.Gender)
  27. .IsRequired()
  28. .IsFixedLength()
  29. .HasMaxLength(1);
  30. this.Property(t => t.Email)
  31. .IsRequired()
  32. .HasMaxLength(50);
  33. this.Property(t => t.CityNo)
  34. .IsRequired()
  35. .HasMaxLength(50);
  36. this.Property(t => t.GraduationYear)
  37. .IsRequired()
  38. .IsFixedLength()
  39. .HasMaxLength(4);
  40. this.Property(t => t.ContactAddress)
  41. .IsRequired();
  42. this.Property(t => t.Workunit)
  43. .IsRequired()
  44. .HasMaxLength(50);
  45. this.Property(t => t.WeChat)
  46. .HasMaxLength(50);
  47. this.Property(t => t.QQ)
  48. .HasMaxLength(15);
  49. this.Property(t => t.Mobile2)
  50. .HasMaxLength(15);
  51. this.Property(t => t.IsAudited)
  52. .IsRequired()
  53. .IsFixedLength()
  54. .HasMaxLength(1);
  55. this.Property(t => t.IsPublic)
  56. .IsRequired()
  57. .IsFixedLength()
  58. .HasMaxLength(1);
  59. this.Property(t => t.IsLocked)
  60. .IsRequired()
  61. .IsFixedLength()
  62. .HasMaxLength(1);
  63. this.Property(t => t.Vip)
  64. .IsRequired()
  65. .IsFixedLength()
  66. .HasMaxLength(10);
  67. this.Property(t => t.Remark)
  68. .HasMaxLength(250);
  69. // Table & Column Mappings
  70. this.ToTable("AlumUsersBackUp");
  71. this.Property(t => t.Id).HasColumnName("Id");
  72. this.Property(t => t.Mobile).HasColumnName("Mobile");
  73. this.Property(t => t.Password).HasColumnName("Password");
  74. this.Property(t => t.Name).HasColumnName("Name");
  75. this.Property(t => t.NickName).HasColumnName("NickName");
  76. this.Property(t => t.Gender).HasColumnName("Gender");
  77. this.Property(t => t.Email).HasColumnName("Email");
  78. this.Property(t => t.Birthday).HasColumnName("Birthday");
  79. this.Property(t => t.CityNo).HasColumnName("CityNo");
  80. this.Property(t => t.GraduationYear).HasColumnName("GraduationYear");
  81. this.Property(t => t.ContactAddress).HasColumnName("ContactAddress");
  82. this.Property(t => t.HomeAddress).HasColumnName("HomeAddress");
  83. this.Property(t => t.Workunit).HasColumnName("Workunit");
  84. this.Property(t => t.WeChat).HasColumnName("WeChat");
  85. this.Property(t => t.QQ).HasColumnName("QQ");
  86. this.Property(t => t.Mobile2).HasColumnName("Mobile2");
  87. this.Property(t => t.DetaileInfo).HasColumnName("DetaileInfo");
  88. this.Property(t => t.IsAudited).HasColumnName("IsAudited");
  89. this.Property(t => t.IsPublic).HasColumnName("IsPublic");
  90. this.Property(t => t.IsLocked).HasColumnName("IsLocked");
  91. this.Property(t => t.Vip).HasColumnName("Vip");
  92. this.Property(t => t.TimeCreate).HasColumnName("TimeCreate");
  93. this.Property(t => t.TimeModify).HasColumnName("TimeModify");
  94. this.Property(t => t.Remark).HasColumnName("Remark");
  95. }
  96. }
  97. }