backend/ExamKing.Core/Entities/Exam/TbClass.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

#nullable disable

namespace ExamKing.Core.Entites
{
    public partial class TbClass : IEntity, IEntityTypeBuilder<TbClass>
    {
        public TbClass()
        {
            Students = new HashSet<TbStudent>();
        }

        public int Id { get; set; }
        public string ClassesName { get; set; }
        public int DeptId { get; set; }
        
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public DateTimeOffset CreateTime { get; set; }

        public TbDept Dept { get; set; }

        public ICollection<TbStudent> Students { get; set; }

        /// <summary>
        /// 多对多
        /// </summary>
        public ICollection<TbCourse> Courses { get; set; }

        /// <summary>
        /// 多对多中间表
        /// </summary>
        public List<TbCourseclass> Courseclasses { get; set; }

        /// <summary>
        /// 多对多
        /// </summary>
        public ICollection<TbExam> Exams { get; set; }

        /// <summary>
        /// 多对多中间表
        /// </summary>
        public ICollection<TbExamclass> Examclasses { get; set; }

        public void Configure(EntityTypeBuilder<TbClass> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            entityBuilder.ToTable("tb_classes");

            entityBuilder.HasComment("班级表");

            entityBuilder.HasIndex(e => e.DeptId, "classes_dept_id");

            entityBuilder.HasIndex(e => e.Id, "classes_id")
                .IsUnique();

后面还有 52 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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