Personalblog.Model/Entitys/Category.cs

(完整代码) 870B

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;

namespace Personalblog.Model.Entitys
{
    /// <summary>
    /// 文章类别类
    /// </summary>
    public class Category
    {
        /// <summary>
        /// 类别id
        /// </summary>
        [Key] //主键
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]//自增
        public int Id { get; set; }
        /// <summary>
        /// 类别名称
        /// </summary>
        public string? Name { get; set; }
        public List<Post>? Posts { get; set; }
        /// <summary>
        /// 分类是否可见
        /// </summary>
        public bool Visible { get; set; } = true;
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。