How to ignore child collection of circular reference in many-to-many navigation properties #3582
Replies: 2 comments 6 replies
-
What do your DTOs look like here? |
Beta Was this translation helpful? Give feedback.
6 replies
-
This discussion has been automatically locked since there has not been any recent activity after it was closed. |
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.
-
Hello everybody
I am currently struggling configuring AutoMapper for the following scenario
What we need is a mapping definition which would ignore the groups collection in users, if we map the group. if we only map the users, the group list should be mapped as well. So basically we need to ignore the collection depending on which is the main entity we are doing an update in our use case.
On the group mapping definition, we would need something like this:
.ForMember(g => g.Users.Select(u => u.Groups), opt => opt.Ignore())
This does not work and ends up with the following error:
Custom configuration for members is only supported for top-level individual members on a type.
Is there a way to configure a mapping for this use case?
Thanks in advance for your help!
Cheers
Marc
Beta Was this translation helpful? Give feedback.
All reactions