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

Consider applying NameMatchingStrategy(NameMatchingStrategy.Flexible) to Dictionary<->Object mapping #63

Closed
kellyethridge opened this issue May 11, 2016 · 2 comments

Comments

@kellyethridge
Copy link

Hello,

From what I can tell, the name matching strategy is only applied between two objects. It would be a big benefit for Dictionary<->Object mapping, especially when using PATCH methods in WebApi since json property names are usually camel-case/snake-case while classes are usually Pascal.

@chaowlert
Copy link
Collaborator

Yeah true, we should also apply name matching to dictionary.

@chaowlert
Copy link
Collaborator

Note: for performance reason, I added 2 strategies
NameMappingStrategy.ToCamelCase is for Object to Dictionary
NameMappingStrategy.FromCamelCase is for Dictionary to Object

NameMappingStrategy.Flexible is also working, but performance might be low.

kellyethridge pushed a commit to kellyethridge/Mapster that referenced this issue Oct 1, 2016
kellyethridge pushed a commit to kellyethridge/Mapster that referenced this issue Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants