重构项目结构,移除Assignment相关功能,优化Submission模块
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
This commit is contained in:
36
Entities/Contracts/Subject.cs
Normal file
36
Entities/Contracts/Subject.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user