UserSelfAuditMap.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class UserSelfAuditMap : EntityTypeConfiguration<UserSelfAudit>
  6. {
  7. public UserSelfAuditMap()
  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.UserNoApply)
  16. .IsRequired()
  17. .HasMaxLength(50);
  18. this.Property(t => t.UserNoInvited)
  19. .IsRequired()
  20. .HasMaxLength(50);
  21. this.Property(t => t.IsLocked)
  22. .IsRequired()
  23. .IsFixedLength()
  24. .HasMaxLength(1);
  25. this.Property(t => t.DisplayApply)
  26. .IsRequired()
  27. .IsFixedLength()
  28. .HasMaxLength(1);
  29. this.Property(t => t.DisplayInvited)
  30. .IsRequired()
  31. .IsFixedLength()
  32. .HasMaxLength(1);
  33. // Table & Column Mappings
  34. this.ToTable("UserSelfAudit");
  35. this.Property(t => t.Id).HasColumnName("Id");
  36. this.Property(t => t.UserNoApply).HasColumnName("UserNoApply");
  37. this.Property(t => t.UserNoInvited).HasColumnName("UserNoInvited");
  38. this.Property(t => t.Status).HasColumnName("Status");
  39. this.Property(t => t.IsLocked).HasColumnName("IsLocked");
  40. this.Property(t => t.DisplayApply).HasColumnName("DisplayApply");
  41. this.Property(t => t.DisplayInvited).HasColumnName("DisplayInvited");
  42. this.Property(t => t.TimeApply).HasColumnName("TimeApply");
  43. this.Property(t => t.TimeInvited).HasColumnName("TimeInvited");
  44. }
  45. }
  46. }