AutoMapper将实体对象映射到KeyValuePair的配置方法
public OrderMappingProfile() { //将实体映射到KeyValuePair键值对 CreateMap<tab_carPlan, KeyValuePair<int, string>>() .ConstructUsing(x => new KeyValuePair<int, string>(x.id, x.timeInterval)); }
配置如上
public OrderMappingProfile() { //将实体映射到KeyValuePair键值对 CreateMap<tab_carPlan, KeyValuePair<int, string>>() .ConstructUsing(x => new KeyValuePair<int, string>(x.id, x.timeInterval)); }
配置如上