IndustryBranchInfoMap.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class IndustryBranchInfoMap : EntityTypeConfiguration<IndustryBranchInfo>
  6. {
  7. public IndustryBranchInfoMap()
  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.IndustryBranchName)
  16. .IsRequired()
  17. .HasMaxLength(50);
  18. this.Property(t => t.SortNo)
  19. .IsFixedLength()
  20. .HasMaxLength(4);
  21. this.Property(t => t.IsLocked)
  22. .IsRequired()
  23. .IsFixedLength()
  24. .HasMaxLength(1);
  25. this.Property(t => t.CreateUserNo)
  26. .HasMaxLength(50);
  27. // Table & Column Mappings
  28. this.ToTable("IndustryBranchInfos");
  29. this.Property(t => t.Id).HasColumnName("Id");
  30. this.Property(t => t.IndustryBranchName).HasColumnName("IndustryBranchName");
  31. this.Property(t => t.Description).HasColumnName("Description");
  32. this.Property(t => t.SortNo).HasColumnName("SortNo");
  33. this.Property(t => t.IsLocked).HasColumnName("IsLocked");
  34. this.Property(t => t.TimeCreated).HasColumnName("TimeCreated");
  35. this.Property(t => t.TimeModify).HasColumnName("TimeModify");
  36. this.Property(t => t.CreateUserNo).HasColumnName("CreateUserNo");
  37. this.Property(t => t.Remark).HasColumnName("Remark");
  38. }
  39. }
  40. }