Use merge mappers for nested properties with entity framework core #1739
Replies: 1 comment
-
Seems to be a duplicate of #1311 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We use mapperly for merging Dto into EF Core Entities.
The target entities however may have other entities as navigation properties (virtual).
When using merger, those properties are using mappers, creating a new entity each time we merge.
This is upsetting an ef core change tracker and basically makes database to do work it should not.
An example:
Generate code for public static partial void MergeToMyThingEntity():
As we can see, the merge will sue mapper to CREATE a new entity and there doesn't seem to be any way to specify that certain property need to be also merged?
Is there any other way besides writing a custom mapper manually?
Beta Was this translation helpful? Give feedback.
All reactions