TbQuestionMapper.cs 554 Bytes
using NCC.Common.Helper;
using NCC.Common.Model;
using NCC.Education.Entitys.Dto.TbQuestion;
using Mapster;
using System.Collections.Generic;

namespace NCC.Education.Entitys.Mapper.TbQuestion
{
	public class Mapper : IRegister
	{
		public void Register(TypeAdapterConfig config)
		{
			config.ForType<TbQuestionCrInput, TbQuestionEntity>()
				.Map(dest => dest.Img, src => src.img.ToJson())
			;
			config.ForType<TbQuestionEntity, TbQuestionInfoOutput>()
				.Map(dest => dest.img, src => src.Img.ToObject<List<FileControlsModel>>())
			;
		}
	}
}