SysFunctionMap.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class SysFunctionMap : EntityTypeConfiguration<SysFunction>
  6. {
  7. public SysFunctionMap()
  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.FunctionName)
  16. .IsRequired()
  17. .HasMaxLength(50);
  18. this.Property(t => t.FatherID)
  19. .IsRequired()
  20. .HasMaxLength(50);
  21. this.Property(t => t.ActionName)
  22. .HasMaxLength(150);
  23. this.Property(t => t.ControllerName)
  24. .HasMaxLength(150);
  25. this.Property(t => t.URL)
  26. .HasMaxLength(500);
  27. this.Property(t => t.IsLeaf)
  28. .IsRequired()
  29. .IsFixedLength()
  30. .HasMaxLength(1);
  31. this.Property(t => t.Path)
  32. .IsRequired()
  33. .HasMaxLength(500);
  34. this.Property(t => t.IsFront)
  35. .IsRequired()
  36. .IsFixedLength()
  37. .HasMaxLength(1);
  38. this.Property(t => t.IsBack)
  39. .IsRequired()
  40. .IsFixedLength()
  41. .HasMaxLength(1);
  42. this.Property(t => t.IsBrowse)
  43. .IsRequired()
  44. .IsFixedLength()
  45. .HasMaxLength(1);
  46. this.Property(t => t.IsAdd)
  47. .IsRequired()
  48. .IsFixedLength()
  49. .HasMaxLength(1);
  50. this.Property(t => t.IsUpdate)
  51. .IsRequired()
  52. .IsFixedLength()
  53. .HasMaxLength(1);
  54. this.Property(t => t.IsDelete)
  55. .IsRequired()
  56. .IsFixedLength()
  57. .HasMaxLength(1);
  58. this.Property(t => t.IsAudit)
  59. .IsRequired()
  60. .IsFixedLength()
  61. .HasMaxLength(1);
  62. this.Property(t => t.IsPrint)
  63. .IsRequired()
  64. .IsFixedLength()
  65. .HasMaxLength(1);
  66. this.Property(t => t.UserIDLastMod)
  67. .HasMaxLength(30);
  68. this.Property(t => t.PageName)
  69. .HasMaxLength(300);
  70. // Table & Column Mappings
  71. this.ToTable("SysFunctions");
  72. this.Property(t => t.Id).HasColumnName("Id");
  73. this.Property(t => t.FunctionName).HasColumnName("FunctionName");
  74. this.Property(t => t.FatherID).HasColumnName("FatherID");
  75. this.Property(t => t.ActionName).HasColumnName("ActionName");
  76. this.Property(t => t.ControllerName).HasColumnName("ControllerName");
  77. this.Property(t => t.URL).HasColumnName("URL");
  78. this.Property(t => t.Depth).HasColumnName("Depth");
  79. this.Property(t => t.IsLeaf).HasColumnName("IsLeaf");
  80. this.Property(t => t.Sort).HasColumnName("Sort");
  81. this.Property(t => t.Path).HasColumnName("Path");
  82. this.Property(t => t.IsFront).HasColumnName("IsFront");
  83. this.Property(t => t.IsBack).HasColumnName("IsBack");
  84. this.Property(t => t.IsBrowse).HasColumnName("IsBrowse");
  85. this.Property(t => t.IsAdd).HasColumnName("IsAdd");
  86. this.Property(t => t.IsUpdate).HasColumnName("IsUpdate");
  87. this.Property(t => t.IsDelete).HasColumnName("IsDelete");
  88. this.Property(t => t.IsAudit).HasColumnName("IsAudit");
  89. this.Property(t => t.IsPrint).HasColumnName("IsPrint");
  90. this.Property(t => t.TimeCreated).HasColumnName("TimeCreated");
  91. this.Property(t => t.TimeLastMod).HasColumnName("TimeLastMod");
  92. this.Property(t => t.UserIDLastMod).HasColumnName("UserIDLastMod");
  93. this.Property(t => t.PageName).HasColumnName("PageName");
  94. }
  95. }
  96. }