Closed bmulh closed 6 months ago
Hi @bmulh, Thank you for your issue. Sorry for very delayed response.
In this situation automapper wouldn't know to which output class to map. You can use instead:
foo = Foo()
bar = mapper.to(Bar).map(foo)
baz = mapper.to(Baz).map(foo)
add(...)
function exists to explicitly associate mapping, e.g. Foo
maps to Bar
or Foo
maps to Baz
.
But if you have more than 1 class that should be associated with Foo
, then there is no way to know what output class user expects to receive: Bar
or Baz
.
It would be nice to be able to register multiple mappings for the same source object like: