MedicalHelpHandleMap.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.Data.Entity.ModelConfiguration;
  3. namespace YZXYH.Repository.Models.Mapping
  4. {
  5. public class MedicalHelpHandleMap : EntityTypeConfiguration<MedicalHelpHandle>
  6. {
  7. public MedicalHelpHandleMap()
  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.HelpNo)
  16. .IsRequired()
  17. .HasMaxLength(50);
  18. this.Property(t => t.HandleNo)
  19. .IsRequired()
  20. .HasMaxLength(50);
  21. this.Property(t => t.Status)
  22. .IsRequired()
  23. .IsFixedLength()
  24. .HasMaxLength(1);
  25. // Table & Column Mappings
  26. this.ToTable("MedicalHelpHandle");
  27. this.Property(t => t.Id).HasColumnName("Id");
  28. this.Property(t => t.HelpNo).HasColumnName("HelpNo");
  29. this.Property(t => t.HandleNo).HasColumnName("HandleNo");
  30. this.Property(t => t.Contents).HasColumnName("Contents");
  31. this.Property(t => t.Status).HasColumnName("Status");
  32. this.Property(t => t.TimeHandle).HasColumnName("TimeHandle");
  33. }
  34. }
  35. }