SysAttachFileMap.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class SysAttachFileMap : EntityTypeConfiguration<SysAttachFile>
  6. {
  7. public SysAttachFileMap()
  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.FileName)
  16. .IsRequired()
  17. .HasMaxLength(500);
  18. this.Property(t => t.FilePath)
  19. .IsRequired();
  20. this.Property(t => t.FileType)
  21. .HasMaxLength(50);
  22. this.Property(t => t.FileExt)
  23. .HasMaxLength(50);
  24. // Table & Column Mappings
  25. this.ToTable("SysAttachFile");
  26. this.Property(t => t.Id).HasColumnName("Id");
  27. this.Property(t => t.FileTitle).HasColumnName("FileTitle");
  28. this.Property(t => t.FileName).HasColumnName("FileName");
  29. this.Property(t => t.FilePath).HasColumnName("FilePath");
  30. this.Property(t => t.FileType).HasColumnName("FileType");
  31. this.Property(t => t.FileExt).HasColumnName("FileExt");
  32. this.Property(t => t.Description).HasColumnName("Description");
  33. }
  34. }
  35. }