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

namespace FMSAdmin.Entities {
    public partial class CmGuideline {
        [Key]
        public int SiteId { get; set; }
        [Key]
        public int GuidelineId { get; set; }
        public int BusinessFieldId { get; set; }
        [Required]
        [StringLength(128)]
        public string Title { get; set; }
        [Required]
        [StringLength(1024)]
        public string Contents { get; set; }
        [Required]
        [StringLength(24)]
        public string RegisterUserId { get; set; }
        public int? FileId { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime AddDate { get; set; }
        [Column(TypeName = "datetime")]
        public DateTime UpdateDate { get; set; }
        public bool? IsUse { get; set; }
        public int ReadCount { get; set; }
        public bool? IsAllView { get; set; }
        [ForeignKey("BusinessFieldId")]
        [InverseProperty("CmGuideline")]
        public virtual CmBusinessField CmBusinessField { get; set; }
        [ForeignKey("SiteId,FileId")]
        [InverseProperty("CmGuideline")]
        public virtual CmFile CmFile { get; set; }
        [ForeignKey("RegisterUserId")]
        [InverseProperty("CmGuideline")]
        public virtual CmUser CmUser { get; set; }

        [ForeignKey("SiteId")]
        public virtual CmSite CmSite { get; set; }
    }
}
