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

(开头部分) 4KB

这里只显示每个文件的开头 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 TbStuanswerdetail : IEntity, IEntityTypeBuilder<TbStuanswerdetail>
    {
        public int Id { get; set; }
        public int StuId { get; set; }
        public int ExamId { get; set; }
        public int QuestionId { get; set; }
        public string QuestionType { get; set; }
        public string Stuanswer { get; set; }
        public string Answer { get; set; }
        public string Isright { get; set; }
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public DateTimeOffset CreateTime { get; set; }

        public TbExam Exam { get; set; }
        public TbStudent Student { get; set; }
        public TbExamquestion Examquestion { get; set; }

        public void Configure(EntityTypeBuilder<TbStuanswerdetail> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {

            {
                entityBuilder.ToTable("tb_stuanswerdetail");

                entityBuilder.HasComment("答题明细表");

                entityBuilder.HasIndex(e => e.ExamId, "answerdetail_exam_id");

                entityBuilder.HasIndex(e => e.StuId, "answerdetail_stu_id");
                
                entityBuilder.HasIndex(e => e.QuestionId, "answerdetail_examquestion_id");

                entityBuilder.HasIndex(e => e.Id, "stuanseerdetail_id")
                    .IsUnique();
                
                entityBuilder.HasIndex(p => new {p.StuId, p.ExamId, p.QuestionId}, "answerdetail_stu_id_question_id")
                    .IsUnique();
                
                entityBuilder.Property(e => e.Id)
                    .HasColumnName("id")
                    .HasComment("ID");

                entityBuilder.Property(e => e.Answer)
                    .IsRequired()
                    .HasColumnType("varchar(100)")
                    .HasColumnName("answer")
                    .HasComment("正确答案")
                    .HasCharSet("utf8")
                    .HasCollation("utf8_general_ci");

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

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

AI 解读 AI

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

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