添加项目文件。
This commit is contained in:
47
Entities/Contracts/User.cs
Normal file
47
Entities/Contracts/User.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Entities.Contracts
|
||||
{
|
||||
public enum UserRoles
|
||||
{
|
||||
Student,
|
||||
Teacher,
|
||||
Administrator
|
||||
}
|
||||
|
||||
public class User : IdentityUser<Guid>
|
||||
{
|
||||
public string? RefreshToken { get; set; }
|
||||
public DateTime? RefreshTokenExpiryTime { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public string? DisplayName { get; set; }
|
||||
|
||||
|
||||
[Column("deleted")]
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
public ICollection<ClassTeacher> TaughtClassesLink { get; set; }
|
||||
public ICollection<ClassStudent> EnrolledClassesLink { get; set; }
|
||||
|
||||
public ICollection<Question> CreatedQuestions { get; set; }
|
||||
public ICollection<Assignment> CreatedAssignments { get; set; }
|
||||
|
||||
public ICollection<SubmissionDetail> SubmissionDetails { get; set; }
|
||||
public ICollection<Submission> SubmissionsAsStudent { get; set; }
|
||||
public ICollection<Submission> GradedSubmissions { get; set; }
|
||||
|
||||
public User()
|
||||
{
|
||||
Id = Guid.NewGuid();
|
||||
SecurityStamp = Guid.NewGuid().ToString();
|
||||
|
||||
CreatedQuestions = new HashSet<Question>();
|
||||
TaughtClassesLink = new HashSet<ClassTeacher>();
|
||||
EnrolledClassesLink = new HashSet<ClassStudent>();
|
||||
CreatedAssignments = new HashSet<Assignment>();
|
||||
GradedSubmissions = new HashSet<Submission>();
|
||||
SubmissionsAsStudent = new HashSet<Submission>();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user