using Furion.JsonSerialization; using YBEE.EQM.Core; namespace YBEE.EQM.Application; /// /// 附件信息转换 /// public class AttachmentMapper : IRegister { public void Register(TypeAdapterConfig config) { // 机构数据项上报附件 config.ForType().Map(d => d.AttachmentList, s => JSON.Deserialize>(s.Attachments, null)); // 特殊学生明细附件 config.ForType().Map(d => d.AttachmentList, s => JSON.Deserialize>(s.Attachments, null)); // 缺测替补明细附件 config.ForType().Map(d => d.AttachmentList, s => JSON.Deserialize>(s.Attachments, null)); // 监测数据上报类型附件 config.ForType().Map(d => d.AttachmentList, s => JSON.Deserialize>(s.Attachments, null)); config.ForType().Map(d => d.SourceId, s => (int)s.SourceId) .Map(d => d.FileId, s => s.Id) .Map(d => d.ThumbFileId, s => s.ThumbResourceFile.Id) ; config.ForType().Map(d => d.SourceId, s => (int)s.SourceId) .Map(d => d.FileId, s => s.Id) .Map(d => d.ThumbFileId, s => s.ThumbResourceFile.Id) ; } }