Add support for mapping inner class
See original GitHub issueIs your feature request related to a problem? Please describe. The internal class can correspond to properties declared as private set.
Describe the solution you’d like
record CarDto(string? Id);
partial class Car
{
public string? Id { get; private set; }
public void Update(CarDto dto)
{
Mapper1 mapper = new Mapper1();
mapper.MergeCarDto(dto, this);
}
[Mapper(UseDeepCloning = true)]
internal partial class Mapper1
{
public partial void MergeCarDto(CarDto source, Car target);
}
}
Describe alternatives you’ve considered Currently using Automapper, but the performance is not optimal.
Additional context N.A.
Issue Analytics
- State:
- Created 2 months ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Mapstruct Mapping nested classes issue - java
I have found a solution: @Mapping(target = "nestedMember", source = ".") Target map(Input input); @Mapping(target = "bb", ...
Read more >Mapping inner classes
Hi, I want to map properties of a class to another, which appears to be inner one. When the Impl class is generated,...
Read more >Inner class does not allow maps
1 Answer. The issue is with the spellings of the access modifier for your second map in the inner class. Please change it...
Read more >Add imports for inner classes given via @Mapper#imports()
When specifying an inner class via @Mapper#imports() which lives in the same package as the given mapper interface, that import is not added...
Read more >Nested Classes - Learning the Java Language
Inner Classes As with instance methods and variables, an inner class is associated with an instance of its enclosing class and has...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good find.
C# properties are two methods that mutate a private backing field ie
<Id>k__BackingField
. Mapperly is trying to map the two fields together. Not sure if this only happens with private set.I’ll see if I can fix it later
🎉 This issue has been resolved in version 3.0.0 🎉
The release is available on:
v3.0.0
Your semantic-release bot 📦🚀