Closed JFercan closed 5 years ago
I'm not sure it's hard to follow. It might have to do with being fields and not properties it's not mapping over. The fact that it has multiple properties for comparison should have nothing to do with the mapping.
@TylerCarlson1 I have updated the code to reflect better what I'm trying to do. I know it should map but unfortunately it does not work. It seems to find the existing ones but it does not create any new objects.
Not an issue, someone added the parent mapping on a different part of the code without the child, making it have this behaviour.
I have the following classes and view models:
The AutoMapper configurations work fine when creating a new entity of ClassA from the view model with the collection. However if I'm editing ClassA and say I add a new ClassEViewModel to the collection in ClassAViewModel, it does not map to a new entry of the ClassD collection of ClassA. Does this does not work because the comparison is done on multiple properties? If so, any ideas as to how I can accomplish this with Automapper?
PS: I do have Automapper collections installed and configured.
Thank you,