struct&&assiQues

This commit is contained in:
SpecialX
2025-06-20 15:37:39 +08:00
parent f37262d72e
commit d20c051c51
68 changed files with 1927 additions and 2869 deletions

View File

@@ -29,10 +29,10 @@ namespace TechHelper.Context.Configuration
.IsRequired()
.HasColumnName("due_date");
builder.Property(a => a.TotalPoints)
builder.Property(a => a.TotalQuestions)
.HasColumnName("total_points");
builder.Property(a => a.CreatedBy)
builder.Property(a => a.CreatorId)
.HasColumnName("created_by");
builder.Property(a => a.CreatedAt)
@@ -54,7 +54,7 @@ namespace TechHelper.Context.Configuration
// 如果 User 有一个名为 AssignmentsCreated 的导航属性,应写为 .WithMany(u => u.AssignmentsCreated)
builder.HasOne(a => a.Creator)
.WithMany() // User 实体没有指向 Assignment 的导航属性 (或我们不知道)
.HasForeignKey(a => a.CreatedBy)
.HasForeignKey(a => a.CreatorId)
.IsRequired(); // CreatedBy 是必填的,对应 [Required] 在外键属性上
// 关系: Assignment (一) 到 AssignmentClass (多)