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

namespace FMSAdmin.Entities {
    public partial class FmsFacilityCodeClass {
        public FmsFacilityCodeClass() {
            this.FmsFacilityCodeClass1 = new HashSet<FmsFacilityCodeClass>();
            this.CmFacility = new HashSet<CmFacility>();
            this.CmFacility1 = new HashSet<CmFacility>();
            this.CmFacility2 = new HashSet<CmFacility>();
        }

        [Display(Name = "설비 분류 코드"), Key]
        public int FacilityClassId { get; set; }
        [Display(Name = "상위 분류 코드")]
        public int? ParentFacilityClassId { get; set; }

        [Display(Name = "메뉴 단계 수"), Required]
        public int Depth { get; set; }
        [Display(Name = "분류명칭"), Required]
        [StringLength(80, ErrorMessage = "분류명칭은 최대 80자까지 입력 가능합니다.")]
        public string Name { get; set; }
        [Display(Name = "약어")]
        [StringLength(40)]
        public string Abbreviation { get; set; }
        [Display(Name = "사용 유무")]
        public bool? IsUse { get; set; }
        [NotMapped]
        [Display(Name = "엑셀행번호")]
        public int ExcelRowNum { get; set; }

        [InverseProperty("FmsFacilityCodeClass2")]
        public virtual ICollection<FmsFacilityCodeClass> FmsFacilityCodeClass1 { get; set; }

        [ForeignKey("ParentFacilityClassId")]
        public virtual FmsFacilityCodeClass FmsFacilityCodeClass2 { get; set; }

        [InverseProperty("FmsFacilityCodeClass")]
        public virtual ICollection<CmFacility> CmFacility { get; set; }
        [InverseProperty("FmsFacilityCodeClass1")]
        public virtual ICollection<CmFacility> CmFacility1 { get; set; }
        [InverseProperty("FmsFacilityCodeClass2")]
        public virtual ICollection<CmFacility> CmFacility2 { get; set; }


    }
}
