-
I have an Object with 4 Lists of navigational properties.
However, for businesslogic reasons in other parts I have one more for one of the 4 Lists that does something else with the same input and needs to be the default since it is used in many different parts, which looks like this:
Since this is the default, when I generate the Code for the Clone Mapper of the parent Entity it results in the following auto-generated Code:
How can I tell the mapper to use CopyEntity4 instead of MapEntity4? I've tried but both result in different errors. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
The types of the [MapProperty(nameof(Entity.Entity4), nameof(Entity.Entity4), Use = nameof(CopyEntity4List))]
...
private List<Entity4> CopyEntity4List(List<Entity4> l) => l.Select(x => CopyEntity4(x)).ToList(); |
Beta Was this translation helpful? Give feedback.
Ah, I see. To achieve this, you would need support for existing target mappings combined with MapProperty.Use, which Mapperly currently does not support. A potential workaround is to separate the mappers by creating a dedicated Copy*Mapper class. This way, you can isolate these mappings and avoid any collisions.
I created #1649.