using AutoMapper; using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Models; namespace IRaCIS.Core.Application.Service { public class CommonConfig : Profile { public CommonConfig() { CreateMap() .ForMember(o => o.MessageTime, t => t.MapFrom(u => u.MessageTime.ToString())); CreateMap(); CreateMap(); CreateMap().ReverseMap(); CreateMap().ReverseMap(); CreateMap(); CreateMap(); CreateMap() .ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code)); CreateMap().ReverseMap(); CreateMap() .ForMember(o => o.ConfigType, t => t.MapFrom(u => u.ConfigDictionary.Code)) .ForMember(o => o.ConfigTypeDes, t => t.MapFrom(u => u.ConfigDictionary.Description)); CreateMap().ReverseMap(); CreateMap() .ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code)); CreateMap(); CreateMap().ReverseMap(); } } }