ExamSampleMapper.cs 835 B

123456789101112131415161718192021
  1. using Furion.JsonSerialization;
  2. using YBEE.EQM.Core;
  3. namespace YBEE.EQM.Application;
  4. public class ExamSampleMapper : IRegister
  5. {
  6. public void Register(TypeAdapterConfig config)
  7. {
  8. config.ForType<ExamSample, ExamSampleOutput>()
  9. .Map(d => d.Config, s => JSON.Deserialize<ExamSampleConfig>(s.Config, null))
  10. .Map(d => d.IsFixedExamSample, s => s.ExamPlan.IsFixedExamSample)
  11. .Map(d => d.EducationStage, s => s.ExamPlan.EducationStage)
  12. ;
  13. config.ForType<ExamSample, ExamSamplePlanOutput>()
  14. .Map(d => d.Config, s => JSON.Deserialize<ExamSampleConfig>(s.Config, null))
  15. .Map(d => d.IsFixedExamSample, s => s.ExamPlan.IsFixedExamSample)
  16. .Map(d => d.EducationStage, s => s.ExamPlan.EducationStage)
  17. ;
  18. }
  19. }