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

namespace FMSAdmin.Entities {
    public partial class CmBuilding {
        public CmBuilding() {
            BemsDevice = new HashSet<BemsDevice>();
            BemsDeviceRunHourly = new HashSet<BemsDeviceRunHourly>();
            BemsEnergyDaily = new HashSet<BemsEnergyDaily>();
            BemsEnergyGoalDaily = new HashSet<BemsEnergyGoalDaily>();
            BemsLoadsHourly = new HashSet<BemsLoadsHourly>();
            BemsMonitoringPoint = new HashSet<BemsMonitoringPoint>();
            BemsZone = new HashSet<BemsZone>();
            CmFloor = new HashSet<CmFloor>();
            CmPatrolPos = new HashSet<CmPatrolPos>();
            CmZone = new HashSet<CmZone>();
            CmZoneTempHumiSet = new HashSet<CmZoneTempHumiSet>();
        }

        [Display(Name = "고유번호"), Key]
        public int SiteId { get; set; }
        public int BuildingId { get; set; }
        [Display(Name = "빌딩명칭"), Required]
        [StringLength(50)]
        public string Name { get; set; }
        [Display(Name = "사용 유무")]
        public bool? IsUse { get; set; }

        public int? FileId { get; set; }
        public int? SortOrderNo { get; set; }

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

        [InverseProperty("CmBuilding")]
        public virtual ICollection<BemsDevice> BemsDevice { get; set; }
        [InverseProperty("CmBuilding")]
        public virtual ICollection<BemsDeviceRunHourly> BemsDeviceRunHourly { get; set; }
        [InverseProperty("CmBuilding")]
        public virtual ICollection<BemsEnergyDaily> BemsEnergyDaily { get; set; }
        [InverseProperty("CmBuilding")]
        public virtual ICollection<BemsEnergyGoalDaily> BemsEnergyGoalDaily { get; set; }
        [InverseProperty("CmBuilding")]
        public virtual ICollection<BemsLoadsHourly> BemsLoadsHourly { get; set; }
        [InverseProperty("CmBuilding")]
        public virtual ICollection<BemsMonitoringPoint> BemsMonitoringPoint { get; set; }
        [InverseProperty("CmBuilding")]
        public virtual ICollection<BemsZone> BemsZone { get; set; }
        [InverseProperty("CmBuilding")]
        public virtual ICollection<CmFloor> CmFloor { get; set; }
        [InverseProperty("CmBuilding")]
        public virtual ICollection<CmPatrolPos> CmPatrolPos { get; set; }
        [InverseProperty("CmBuilding")]
        public virtual ICollection<CmZone> CmZone { get; set; }
        [InverseProperty("CmBuilding")]
        public virtual ICollection<CmZoneTempHumiSet> CmZoneTempHumiSet { get; set; }
    }
}
