Automapper: Automapper 5 and DynamicMap, I can't find its equivalent

Created on 7 Jul 2016  路  3Comments  路  Source: AutoMapper/AutoMapper

I'm trying to map a DataTable to a list which I used DynamicMap for previously. Is this functionality still available in 5?

Most helpful comment

I didn't know you could go DataTable to List. But you need to create maps on the fly:

Mapper.Initialize(cfg => cfg.CreateMissingTypeMaps = true);

That way you don't have Mapper.Map and Mapper.DynamicMap, just Mapper.Map.

All 3 comments

I didn't know you could go DataTable to List. But you need to create maps on the fly:

Mapper.Initialize(cfg => cfg.CreateMissingTypeMaps = true);

That way you don't have Mapper.Map and Mapper.DynamicMap, just Mapper.Map.

Ahh! Thats the missing piece. I meant List<Dictionary<string,object>>;)

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings