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

37 lines
1002 B
C#

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Entities.Contracts
{
[Table("subjects")]
public class Subject
{
[Key]
[Column("id")]
public Guid Id { get; set; }
[Column("name")]
[MaxLength(20)]
public string Name { get; set; }
[Column("description")]
public string Description { get; set; }
[InverseProperty(nameof(QuestionType.Subject))]
public virtual IEnumerable<QuestionType> QuestionTypes { get; set; }
[InverseProperty(nameof(Question.Subject))]
public virtual IEnumerable<Question> Questions { get; set; }
[InverseProperty(nameof(User.TeachSubject))]
public virtual IEnumerable<User> SubjectTeachers { get; set; }
public Subject()
{
Id = Guid.NewGuid();
QuestionTypes = new HashSet<QuestionType>();
Questions = new HashSet<Question>();
}
}
}