using Furion.JsonSerialization;
using YBEE.EQM.Core;

namespace YBEE.EQM.Application;

public class ExamCourseMapper : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        config.ForType<ExamCourse, ExamCourseLiteOutput>().Map(d => d.ScoreReportConfig, s => JSON.Deserialize<ExamCourseScoreReportConfig>(s.ScoreReportConfig, null));
        config.ForType<ExamCourse, ExamCourseOutput>().Map(d => d.ScoreReportConfig, s => JSON.Deserialize<ExamCourseScoreReportConfig>(s.ScoreReportConfig, null));
    }
}
