using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FMSAdmin.Entities
{
    public partial class CmPatrolHistoryPos
    {
        public int SiteId { get; set; }
        public int PatrolHistoryId { get; set; }
        public int PosId { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime PatrolTime { get; set; }
        [Column("term")]
        public int? Term { get; set; }
        [Column("resultType")]
        public int ResultType { get; set; }
        [Key]
        [Column("mId")]
        public int MId { get; set; }

        [ForeignKey("SiteId,PosId")]
        [InverseProperty("CmPatrolHistoryPos")]
        public virtual CmPatrolPos CmPatrolPos { get; set; }
        [ForeignKey("SiteId,ResultType")]
        [InverseProperty("CmPatrolHistoryPos")]
        public virtual CmPatrolType CmPatrolType { get; set; }
        [ForeignKey(nameof(SiteId))]
        [InverseProperty(nameof(CmSite.CmPatrolHistoryPos))]
        public virtual CmSite Site { get; set; }
    }
}
