AutoMapper throws AutoMapperConfigurationException for one mapping but not for another -
i have test calls mapper.configurationprovider.assertconfigurationisvalid();
i getting automapperconfigurationexception when try map ireadonlycollection list, second time try this.
i on automapper version 6.0.2. edit: ran on latest version 6.1.1 , still got error.
i have 4 classes.
foorowfoobarrowbar
i have following mappings.
createmap<foorow, foo>createmap<ireadonlycollection<foorow>, list<foo>>createmap<barrow, bar>createmap<ireadonlycollection<barrow>, list<bar>>
only #4 fails. given error unmapped properties: capacity. now, #4 can add .formember(d => d.capacity, o => o.ignore) more interested in must second mapping of bar not foo.
it might worth trying remove collection mappings, given automapper has built-in support arrays , lists:
https://github.com/automapper/automapper/wiki/lists-and-arrays
Comments
Post a Comment