Replies: 3 comments 5 replies
This comment has been hidden.
This comment has been hidden.
-
I can't for my life find out where the actual mapping is performed. No matter how often, slow or accurate I debug or step into the methods, I never end up in any of the The closest sections I can step into are
and the before it calls the next one. I have absolutely no means to see what happens after the execution plan is picked up (or even what's picked up). I already spent like 6-7 days now trying to debug it and step into it and I am not the tiniest bit closer to the solutioon or reason for this to happen. I know that my implementation of the With this model, the deduplication works flawlessly
Which ends up with a collection of 2 items. I have no idea where or how AutoMapper caches stuff inside or why it would suddenly use a different |
Beta Was this translation helpful? Give feedback.
-
After further spending many more days, I got at least a little bit closer. Still can't explain the behvaior, any hints? When I call it with
It doesn't work. But when initializing the Spouse with an empty object, it does.
Why? When Spouse is This works in the unit test, but of course in real world I wouldn't know which properties are null or not when starting the mapping, so what could be interfering here? |
Beta Was this translation helpful? Give feedback.
-
I am creating an
IObjectMapper
(based on the AutoMapper.Collection'sEquivalentExpressionCollectionMapper
which resolvesentities from EF Core (either query or from it's
DbSet<T>().Local
store) to preserve the references of the entities when mapping into an entity.So far it works good, when the collection is property of the mapped object. When the property is part of a child's model referenced by the mapped object, the
IObjectMapper
instance is not resolved / called.Mapping configuration
Version: 10,1.1
EF Core 5.0
AutoMapper.Collection 7.0.1
AutoMapper.Collection.EntityFrameworkCore 7.0.1
Expected behavior
That
IObjectMapper
is called on child properties (parentDto.Spouse.Children
) as it is onparentDto.Children
too.Actual behavior
IObjectMapper
is only resolved onparentDto.Children
Steps to reproduce
Beta Was this translation helpful? Give feedback.
All reactions