using System.ComponentModel;
using Hotline.Exams.Base;
using SqlSugar;

namespace Hotline.Exams.Sourcewares
{
    /// <summary>
    /// 课件类型
    /// </summary>
    [Description("课件类型")]
    public class ExamSourcewareCategory : ExamBusinessEntity, IParentEntity
    {
        /// <summary>
        /// 名称
        /// </summary>
        [Description("名称")]
        [SugarColumn(ColumnDescription= "名称")]
        public string Name { get; set; }

        /// <summary>
        /// 父级ID
        /// </summary>
        [Description("父级ID")]
        [SugarColumn(ColumnDescription = "父级ID")]
        public string? ParentId { get; set; }

        /// <summary>
        /// 父级
        /// </summary>
        [Navigate(NavigateType.OneToOne,nameof(ParentId))]
        public ExamSourcewareCategory Parent { get; set; }

        /// <summary>
        /// 子分类
        /// </summary>
        [Description("子分类")]
        [SugarColumn(IsIgnore = true)]
        public List<ExamSourcewareCategory> Children { get; set; }
    }
}
