ViewUserCityInfoMap.cs 4.3 KB

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