Map a FK element to target string #1060
-
I have started to evaluate the usage of Mapperly as it has exceptional performance numbers. I am struggling to do the following mapping: public partial class TaskMapper
{
[MapProperty(new[] { nameof(TaskSub.CreatedByUser), nameof(TaskSub.CreatedByUser.FullName) }, new[] { nameof(GetAllTask.User) })]
public partial List<GetAllTask> ToGetAllTask(List<TaskSub> taskSub);
} |
Beta Was this translation helpful? Give feedback.
Answered by
latonz
Jan 15, 2024
Replies: 1 comment 1 reply
-
Your MapProperty configuration seems to target the objects of the list not the list itself that is why you also need to configure it on the objects: public partial List<GetAllTask> ToGetAllTask(List<TaskSub> taskSub);
[MapProperty(new[] { nameof(TaskSub.CreatedByUser), nameof(TaskSub.CreatedByUser.FullName) }, new[] { nameof(GetAllTask.User) })]
public partial GetAllTask ToGetAllTask(TaskSub taskSub); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
hiperoxid98
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your MapProperty configuration seems to target the objects of the list not the list itself that is why you also need to configure it on the objects: