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.

  • foorow
  • foo
  • barrow
  • bar

i have following mappings.

  1. createmap<foorow, foo>
  2. createmap<ireadonlycollection<foorow>, list<foo>>
  3. createmap<barrow, bar>
  4. 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

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

Why does math.random(999999999999) returns 1 in Lua? -