AsiignmentStruct

This commit is contained in:
SpecialX
2025-06-20 18:58:11 +08:00
parent d20c051c51
commit 681c0862b6
32 changed files with 414 additions and 752 deletions

View File

@@ -50,10 +50,11 @@ namespace TechHelper.Context
// =============================================================
// ENTITY -> DTO Mappings (用于读取/查询)
// =============================================================
CreateMap<Assignment, AssignmentDto>()
.ForMember(dest => dest.ExamStruct, opt => opt.MapFrom(src => src.ExamStruct));
CreateMap<Assignment, AssignmentDto>();
CreateMap<QuestionContext, QuestionContextDto>().ReverseMap();
CreateMap<AssignmentStruct, AssignmentStructDto>(); // 直接映射,因为成员现在对等了
// 新增!从实体到新的 DTO 的映射
CreateMap<AssignmentQuestion, AssignmentQuestionDto>();
@@ -64,7 +65,6 @@ namespace TechHelper.Context
// DTO -> ENTITY Mappings (用于创建/更新) - 现在变得极其简单!
// =================================================================
CreateMap<AssignmentDto, Assignment>();
CreateMap<AssignmentStructDto, AssignmentStruct>();
// 新增!从新的 DTO 到实体的映射
CreateMap<AssignmentQuestionDto, AssignmentQuestion>();