-
Notifications
You must be signed in to change notification settings - Fork 333
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
Private Sets #385
Comments
I am encountering the same issue. My application has an always-valid domain model and I rely heavily on encapsulation, constructors, and methods. I do not expose setters (nor do I intend to), so it is an even worse situation than the above because the generated code does not compile. My entity looks like this (I have removed members irrelevant to this issue):
Input DTO I want to map from (note: this is a custom DTO, not an autogenerated one):
The interface I am using for mapper generation:
The code generated by Mapster.Tool
The configuration:
|
Hi.
I don't know if it's a feature or a bug, but I have an issue that I don't understand why it's happening.
I've an Entity with public getters, private setters and a constructor with parameters:
And my View Model:
I wrote this configuration:
It works, but, I don't know why, after mapping to constructor, It uses entity private setters, losing the validation and data manipulation done in the ctor.
How can I change this behavior?
The text was updated successfully, but these errors were encountered: