Skip to content

What am I doing wrong? #515

Closed Answered by TimothyMakkison
baynezy asked this question in Q&A
Jun 22, 2023 · 3 comments · 5 replies
Discussion options

You must be logged in to vote

Is this worth adding as an issue?

Please do, I have a couple ideas of how to resolve this in the future. It would be handy to have something to point to. I also found a bug trying to help you 😄

Nice idea, but it still is unhappy even if I use the primary constructor.
I guess I will do this one manually.

Just thought of something. Try the following:

[MapProperty(nameof(UpdateProfileRequest.ProfileId), nameof(Profile.Id))]
internal static partial Profile UpdateProfileRequestToProfile(UpdateProfileRequest req);

private static Email Map(string value)
{
    return new Email() { Address = value};
}

Mapperly will see a matching Email member on the source and attempt to map string -> Email, …

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@baynezy
Comment options

@TimothyMakkison
Comment options

@baynezy
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by baynezy
Comment options

You must be logged in to vote
2 replies
@TimothyMakkison
Comment options

@baynezy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants