Mapping `init` or `required` properties does not use `PropertyNameMappingStrategy`
See original GitHub issueDescribe the bug
Mapping to required
or init
properties doesn’t use the PropertyNameMappingStrategy
.
Expected behavior
Mapping should use PropertyNameMappingStrategy
Code snippets
[Mapper(PropertyNameMappingStrategy = PropertyNameMappingStrategy.CaseInsensitive)]
public static partial class Mapper
{
public static partial B Map(A src);
}
public class A
{
public int Value { get; set; }
}
public class B
{
// can also be required
public int value { get; init; }
}
Generated code
public static partial global::Riok.Mapperly.Sample.B Map(global::Riok.Mapperly.Sample.A src)
{
var target = new global::Riok.Mapperly.Sample.B();
return target;
}
Issue Analytics
- State:
- Created 3 months ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Releases · riok/mapperly
A .NET source generator for generating object mappings. ... required/init properties not using PropertyNameMappingStrategy (#505) (#556) (564a43e) ...
Read more >How to properly use 'init' to prevent the error: "property ...
I am creating an application that receives the localization information from an Apple Watch and with the coordinates that I receive, I want...
Read more >How to access Class's property in required convenience init?
One way is making it a class property. Code Block. class Person: NSObject, NSCoding {.
Read more >Initialization | Documentation - Swift.org
Classes and structures must set all of their stored properties to an appropriate initial value by the time an instance of that class...
Read more >SE-0400: Init Accessors - Proposal Reviews
All computed properties with init accessors are initialized on all paths. This doesn't line up with the degrees/radians example, in which only ...
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
@cristianUrbina FYI here is a guide on how to request a review: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review. However, I just noted this may only be possible for accounts having write access to the repository…
@cristianUrbina thank you very much for the contribution 😊 Well done! 🚀