Files
TechHelper/Entities/Contracts/Question.cs
SpecialX ac900159ba
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
重构项目结构,移除Assignment相关功能,优化Submission模块
2025-10-09 18:57:28 +08:00

81 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Entities.Contracts
{
[Table("questions")]
public class Question
{
[Key]
[Column("id")]
public Guid Id { get; set; }
[Required]
[Column("title")]
[MaxLength(65535)]
public string Title { get; set; }
[Column("answer")]
[MaxLength(65535)]
public string? Answer { get; set; }
[Required]
[Column("type")]
public Guid QuestioTypeId { get; set; }
[ForeignKey(nameof(QuestioTypeId))]
public virtual QuestionType QuestionType { get; set; }
[Column("subject_area")]
public Guid SubjectId { get; set; }
[ForeignKey(nameof(SubjectId))]
public virtual Subject Subject { get; set; }
[Column("key_point")]
public Guid? KeyPointId { get; set; }
[ForeignKey(nameof(KeyPointId))]
public virtual KeyPoint? KeyPoint { get; set; }
[Column("lesson")]
public Guid? LessonId { get; set; }
[ForeignKey(nameof(LessonId))]
public virtual Lesson? Lesson { get; set; }
//[Required]
//[Column("created_by")]
//public Guid CreatorId { get; set; }
//[ForeignKey(nameof(CreatorId))]
//public virtual User Creator { get; set; }
//[Column("difficulty_level")]
//public DifficultyLevel DifficultyLevel { get; set; } = DifficultyLevel.easy;
[Column("options")]
public string? Options { get; set; }
[Column("created_at")]
public DateTime CreatedAt { get; set; }
[Column("updated_at")]
public DateTime UpdatedAt { get; set; }
[Column("deleted")]
public bool IsDeleted { get; set; }
[InverseProperty(nameof(ExamQuestion.Question))]
public virtual ICollection<ExamQuestion>? ExamQuestions { get; set; }
public Question()
{
Id = Guid.NewGuid();
ExamQuestions = new HashSet<ExamQuestion>();
}
}
}