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

57 lines
1.5 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
using Microsoft.EntityFrameworkCore;
namespace Entities.Contracts
{
/// <summary>
/// 班级用户关联实体类
/// 表示用户与班级之间的多对多关系
/// </summary>
[Table("class_user")]
[PrimaryKey(nameof(ClassId), nameof(UserId))]
public class ClassUser
{
/// <summary>
/// 班级ID复合主键的一部分外键
/// 关联到Class表中的班级
/// </summary>
[Key]
[Column("class_id", Order = 0)]
public Guid ClassId { get; set; }
[ForeignKey(nameof(ClassId))]
public virtual Class Class { get; set; }
/// <summary>
/// 用户ID复合主键的一部分外键
/// 关联到User表中的用户用户
/// </summary>
[Key]
[Column("student_id", Order = 1)]
public Guid UserId { get; set; }
[ForeignKey(nameof(UserId))]
public virtual User User { get; set; }
/// <summary>
/// 入学日期
/// 记录用户加入该班级的日期
/// </summary>
[Column("enrollment_date")]
public DateTime EnrollmentDate { get; set; }
/// <summary>
/// 是否已删除
/// 软删除标记true表示已删除
/// </summary>
[Column("deleted")]
public bool IsDeleted { get; set; }
}
}