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

How Map From A Method Like Update ? #687

Open
AmBplus opened this issue Mar 19, 2024 · 0 comments
Open

How Map From A Method Like Update ? #687

AmBplus opened this issue Mar 19, 2024 · 0 comments

Comments

@AmBplus
Copy link

AmBplus commented Mar 19, 2024

"I’m working with a complex model. When I need to update an instance of this model, I want to avoid changing certain fields like createDate. Currently, I can't achieve this by using a constructor with global settings to use the constructor. However, I’d like to specify a custom method for mapping instead of relying solely on the constructor. How can I achieve this using Mapster?

For example, I’d like to do something like:

TypeAdapterConfig.GlobalSettings.Default.MapToConstructor(true).UseMethod("Update");
i mean do it automate
Where the method Update would handle the mapping. Is there a way to achieve this with Mapster?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant