MapsterMapper / Mapster

A fast, fun and stimulating object to object Mapper
MIT License
4.29k stars 327 forks source link

Fix MapsterMapper#370 where capitalized abbreviations are not mapped … #590

Closed joshslark closed 1 year ago

joshslark commented 1 year ago

…properly between records

This PR fixes an issue where when you have a destination member that isn't in pascal case for a record, then it will ignore the mapping. (#370)

In ValueAccessingStrategy.cs, the custom resolver destination member is compared for equality against the ParameterModel destination member. However, in ParameterModel, it modifies the destination member to force it to be Pascal Case. I couldn't figure out exactly why we do this, but it breaks a number of tests if you change it.

The only solution I could find that avoids breaking any tests is to compare the two destination members ignoring case. Even if this isn't the correct solution, hopefully this will help someone more familiar create a better solution.

RobKoda commented 11 months ago

Hello!

Any idea on when this will be published? Even as a prerelease nuget? Latest prerelease (pre06) seems to be 7 months old, while this fix was merged 4 months ago.

andrerav commented 11 months ago

Hi @RobKoda, I released 7.4.0 yesterday. Apologies for the delay, it's been a busy summer :)

elmondir commented 10 months ago

this still happen with property Name FrName

mehmetozkaya commented 9 months ago

Error still continue and not mapped _ properties i.e. Address_FirstName in 7.4.0 version.