ViewUserCreateActivityMap.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class ViewUserCreateActivityMap : EntityTypeConfiguration<ViewUserCreateActivity>
  6. {
  7. public ViewUserCreateActivityMap()
  8. {
  9. // Primary Key
  10. this.HasKey(t => new { t.Id, t.AcName, t.AcDate, t.AcType, t.Comments, t.ContactUser, t.Address, t.TimeEnd });
  11. // Properties
  12. this.Property(t => t.Id)
  13. .IsRequired()
  14. .HasMaxLength(32);
  15. this.Property(t => t.AcName)
  16. .IsRequired()
  17. .HasMaxLength(100);
  18. this.Property(t => t.AcDate)
  19. .IsRequired()
  20. .HasMaxLength(50);
  21. this.Property(t => t.AcType)
  22. .IsRequired()
  23. .HasMaxLength(50);
  24. this.Property(t => t.Comments)
  25. .IsRequired();
  26. this.Property(t => t.Stauts)
  27. .IsFixedLength()
  28. .HasMaxLength(1);
  29. this.Property(t => t.ContactUser)
  30. .IsRequired()
  31. .HasMaxLength(50);
  32. this.Property(t => t.Address)
  33. .IsRequired()
  34. .HasMaxLength(200);
  35. this.Property(t => t.MaxNum)
  36. .HasMaxLength(10);
  37. this.Property(t => t.IsLocked)
  38. .IsFixedLength()
  39. .HasMaxLength(1);
  40. this.Property(t => t.Cost)
  41. .HasMaxLength(10);
  42. this.Property(t => t.CreatedUserNo)
  43. .HasMaxLength(50);
  44. this.Property(t => t.HeadDisply)
  45. .IsFixedLength()
  46. .HasMaxLength(1);
  47. this.Property(t => t.SortNo)
  48. .HasMaxLength(4);
  49. this.Property(t => t.Name)
  50. .HasMaxLength(50);
  51. this.Property(t => t.HobbyGroupName)
  52. .HasMaxLength(50);
  53. this.Property(t => t.GraduationYear)
  54. .IsFixedLength()
  55. .HasMaxLength(4);
  56. // Table & Column Mappings
  57. this.ToTable("ViewUserCreateActivity");
  58. this.Property(t => t.Id).HasColumnName("Id");
  59. this.Property(t => t.AcName).HasColumnName("AcName");
  60. this.Property(t => t.AcDate).HasColumnName("AcDate");
  61. this.Property(t => t.AcType).HasColumnName("AcType");
  62. this.Property(t => t.Comments).HasColumnName("Comments");
  63. this.Property(t => t.Stauts).HasColumnName("Stauts");
  64. this.Property(t => t.ContactUser).HasColumnName("ContactUser");
  65. this.Property(t => t.Address).HasColumnName("Address");
  66. this.Property(t => t.MaxNum).HasColumnName("MaxNum");
  67. this.Property(t => t.IsLocked).HasColumnName("IsLocked");
  68. this.Property(t => t.Cost).HasColumnName("Cost");
  69. this.Property(t => t.TimeStart).HasColumnName("TimeStart");
  70. this.Property(t => t.TimeEnd).HasColumnName("TimeEnd");
  71. this.Property(t => t.TimeCreated).HasColumnName("TimeCreated");
  72. this.Property(t => t.TimeModify).HasColumnName("TimeModify");
  73. this.Property(t => t.CreatedUserNo).HasColumnName("CreatedUserNo");
  74. this.Property(t => t.HeadDisply).HasColumnName("HeadDisply");
  75. this.Property(t => t.SortNo).HasColumnName("SortNo");
  76. this.Property(t => t.Name).HasColumnName("Name");
  77. this.Property(t => t.HobbyGroupName).HasColumnName("HobbyGroupName");
  78. this.Property(t => t.GraduationYear).HasColumnName("GraduationYear");
  79. }
  80. }
  81. }