Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support mapping nested object properties directly from mapping function parameters #1719

Open
TeckTn opened this issue Feb 12, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@TeckTn
Copy link

TeckTn commented Feb 12, 2025

related #1472

I would like to request a feature. Specifically, I would like it to support mapping nested objects properties directly from mapping function parameters.

For example, consider the following scenario:

public class ParentDto
{
    public required ChildDto Child { get; set; }
}

public class ChildDto
{
    public required string Name { get; set; }
}


public class ParentDomain
{
    public required string Id {get; init;}
    public required ChildDomain Child { get; set; }
}

public class ChildDomain
{
    public required string Id {get; init;}
    public required string Name { get; set; }
}

I want enabling this mapping scénario :

public static partial class Mapper
{

    [MapPropertyFromParameter(nameof(ParentDomain.Id), "parentId"]
    [MapPropertyFromParameter(nameof(ParentDomain.Child.Id), "childId"]
    public static partial ParentDomain ToDomain(this ParentDto parent, string parentId, string childId);
}
@TeckTn TeckTn added the enhancement New feature or request label Feb 12, 2025
@TeckTn TeckTn changed the title Support Mapping Nested Object Properties Directly from Mapping Function Parameters Support mapping nested object properties directly from mapping function parameters Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant