ViewUserVocationMap.cs 3.9 KB

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