ViewAttendMeetMap.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class ViewAttendMeetMap : EntityTypeConfiguration<ViewAttendMeet>
  6. {
  7. public ViewAttendMeetMap()
  8. {
  9. // Primary Key
  10. this.HasKey(t => t.AMNo);
  11. // Properties
  12. this.Property(t => t.Name)
  13. .HasMaxLength(50);
  14. this.Property(t => t.Mobile)
  15. .HasMaxLength(15);
  16. this.Property(t => t.AMNo)
  17. .IsRequired()
  18. .HasMaxLength(50);
  19. this.Property(t => t.AMName)
  20. .HasMaxLength(100);
  21. this.Property(t => t.AMYear)
  22. .IsFixedLength()
  23. .HasMaxLength(4);
  24. this.Property(t => t.GraduationYear)
  25. .IsFixedLength()
  26. .HasMaxLength(4);
  27. // Table & Column Mappings
  28. this.ToTable("ViewAttendMeets");
  29. this.Property(t => t.Name).HasColumnName("Name");
  30. this.Property(t => t.Mobile).HasColumnName("Mobile");
  31. this.Property(t => t.AMNo).HasColumnName("AMNo");
  32. this.Property(t => t.AMName).HasColumnName("AMName");
  33. this.Property(t => t.AMYear).HasColumnName("AMYear");
  34. this.Property(t => t.GraduationYear).HasColumnName("GraduationYear");
  35. }
  36. }
  37. }