using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;

namespace FMSAdmin.Entities {
    public partial class CmUserGroup {
        public CmUserGroup() {
            CmUser = new HashSet<CmUser>();
            CmUserGroupPermission = new HashSet<CmUserGroupPermission>();
        }

        [Display(Name = "현장 고유번호"), Key]
        public int SiteId { get; set; }
        [Display(Name = "사용자 그룹 고유번호"), Key]
        public int UserGroupId { get; set; }
        [Display(Name = "사용자 그룹 이름"), Required]
        [StringLength(32)]
        public string Name { get; set; }

        [ForeignKey(nameof(SiteId))]
        [InverseProperty(nameof(CmSite.CmUserGroup))]
        public virtual CmSite Site { get; set; }
        [InverseProperty("CmUserGroup")]
        public virtual ICollection<CmUser> CmUser { get; set; }
        [InverseProperty("CmUserGroup")]
        public virtual ICollection<CmUserGroupPermission> CmUserGroupPermission { get; set; }
    }
}
