CmPatrolPlan.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. namespace FMSAdmin.Entities
  6. {
  7. public partial class CmPatrolPlan
  8. {
  9. public CmPatrolPlan()
  10. {
  11. CmPatrolSchedule = new HashSet<CmPatrolSchedule>();
  12. }
  13. [Key]
  14. public int SiteId { get; set; }
  15. [Key]
  16. public int PatrolPlanId { get; set; }
  17. public int GroupId { get; set; }
  18. public int CourseId { get; set; }
  19. [Required]
  20. [StringLength(48)]
  21. public string Name { get; set; }
  22. [StringLength(1024)]
  23. public string PlanDesc { get; set; }
  24. [Column("term")]
  25. public int Term { get; set; }
  26. [Column("inDate", TypeName = "datetime")]
  27. public DateTime? InDate { get; set; }
  28. [ForeignKey("SiteId,CourseId")]
  29. [InverseProperty("CmPatrolPlan")]
  30. public virtual CmPatrolCourse CmPatrolCourse { get; set; }
  31. [ForeignKey("SiteId,GroupId")]
  32. [InverseProperty("CmPatrolPlan")]
  33. public virtual CmPatrolGroup CmPatrolGroup { get; set; }
  34. [ForeignKey(nameof(SiteId))]
  35. [InverseProperty(nameof(CmSite.CmPatrolPlan))]
  36. public virtual CmSite Site { get; set; }
  37. [InverseProperty("CmPatrolPlan")]
  38. public virtual ICollection<CmPatrolSchedule> CmPatrolSchedule { get; set; }
  39. }
  40. }