AlumniChapterUserMap.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class AlumniChapterUserMap : EntityTypeConfiguration<AlumniChapterUser>
  6. {
  7. public AlumniChapterUserMap()
  8. {
  9. // Primary Key
  10. this.HasKey(t => t.Id);
  11. // Properties
  12. this.Property(t => t.Id)
  13. .IsRequired()
  14. .HasMaxLength(50);
  15. this.Property(t => t.AlumniChapterNo)
  16. .IsRequired()
  17. .HasMaxLength(50);
  18. this.Property(t => t.UserNo)
  19. .IsRequired()
  20. .HasMaxLength(50);
  21. this.Property(t => t.UserRole)
  22. .HasMaxLength(50);
  23. this.Property(t => t.Duty)
  24. .HasMaxLength(50);
  25. this.Property(t => t.IsActive)
  26. .IsFixedLength()
  27. .HasMaxLength(1);
  28. this.Property(t => t.IsMember)
  29. .IsFixedLength()
  30. .HasMaxLength(1);
  31. this.Property(t => t.IsLocked)
  32. .IsRequired()
  33. .IsFixedLength()
  34. .HasMaxLength(1);
  35. this.Property(t => t.SortNo)
  36. .IsFixedLength()
  37. .HasMaxLength(4);
  38. // Table & Column Mappings
  39. this.ToTable("AlumniChapterUsers");
  40. this.Property(t => t.Id).HasColumnName("Id");
  41. this.Property(t => t.AlumniChapterNo).HasColumnName("AlumniChapterNo");
  42. this.Property(t => t.UserNo).HasColumnName("UserNo");
  43. this.Property(t => t.UserRole).HasColumnName("UserRole");
  44. this.Property(t => t.Duty).HasColumnName("Duty");
  45. this.Property(t => t.IsActive).HasColumnName("IsActive");
  46. this.Property(t => t.IsMember).HasColumnName("IsMember");
  47. this.Property(t => t.IsLocked).HasColumnName("IsLocked");
  48. this.Property(t => t.SortNo).HasColumnName("SortNo");
  49. this.Property(t => t.TimeCreate).HasColumnName("TimeCreate");
  50. }
  51. }
  52. }