Files
TechHelper/TechHelper.Client/Content/AutoMapperProFile.cs
SpecialX a21ca80782 1
2025-06-27 19:03:10 +08:00

25 lines
617 B
C#

using AutoMapper;
using AutoMapper.Internal.Mappers;
using Entities.Contracts;
using Entities.DTO;
using TechHelper.Client.Exam;
namespace TechHelper.Context
{
public class AutoMapperProFile : Profile
{
public AutoMapperProFile()
{
CreateMap<QuestionEx, QuestionDto>()
.ForMember(d => d.Options, o => o.MapFrom(s => string.Join(Environment.NewLine, s.Options.Select(op => op.Text))));
CreateMap<AssignmentQuestionEx, AssignmentQuestionDto>()
.ForMember(d=>d.Description, o=>o.Ignore());
CreateMap<AssignmentEx, AssignmentDto>();
CreateMap<AssignmentCheckData, Submission>();
}
}
}