Mapper.Initialize(cfg =>
{
cfg.CreateMap<Event_Data_His_Dtl, TViewModel>()
.ForMember(x => x, y =>
y.MapFrom(p => eventSetting.Where(s =>
s.EventCode == p.EventCode).Select(s => s.EventDesc).FirstOrDefault()));
});
我的eventSetting是Model为值
价值的关键
但TViewModel通用我不知道如何工作