CreateMap<Application, ApplicationDto>()
.ForMember(dest => dest.Enabled, opt => opt.MapFrom(s => s.Enabled == true ? "已啟用" : "未啟用"))
.ForMember(dest => dest.RegisterEnabled, opt => opt.MapFrom(s => s.RegisterEnabled == true ? "已啟用注冊(cè)" : "未啟用注冊(cè)"))
.ReverseMap();
CreateMap<ApplicationDto, Application>().ForMember(dest => dest.Enabled, opt => opt.MapFrom(s => s.Enabled == "已啟用" ? true : false))
.ForMember(dest => dest.RegisterEnabled, opt => opt.MapFrom(s => s.RegisterEnabled == "已啟用注冊(cè)" ? true : false))
.ReverseMap();
類型間的相互轉(zhuǎn)換
?
來自:https://www.cnblogs.com/Anthony518/p/11038392.html
本文摘自 :https://www.cnblogs.com/