You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although the set-up is a bit different, I think some ideas from AutoMapper could be borrowed...
Currently the .Map function is a bit confusing to use.
First of all it will only be executed for properties where map via annotation failed (somehow feels as if it'd be conflicting with those annotations). And second: the given interface is hard to use (needs a lot of extra code).
Would consider (at least excel to object) following changes:
No1
have a ShouldMap function to replace the current .Map - first callback function (should map column)
should provide original excel column
should provide mapped destination property (if a match via attributes was found) - along with some match details
should return
null (if no mapping should occure)
or the destination property with a transformation function (optional)
No2
the Map function should change as follows (to work similarly as in case of AutoMapper):
should be aware of the original excel column
as of the destination column
...and should allow to do any kind of data manipulation from the excel value, before assigning it to the destination property (even value type changes by parsing and so)
Currently we need to match column names as find property names before we can do any extra changes... This would be maybe the first thing i'd consider to change (to pass the matched propertyname to the call)!
No3
AfterMap / BeforeMap could also help to do extra manipulation
The text was updated successfully, but these errors were encountered:
Proposed changes to .Map
Although the set-up is a bit different, I think some ideas from AutoMapper could be borrowed...
Currently the .Map function is a bit confusing to use.
First of all it will only be executed for properties where map via annotation failed (somehow feels as if it'd be conflicting with those annotations). And second: the given interface is hard to use (needs a lot of extra code).
Would consider (at least excel to object) following changes:
No1
have a ShouldMap function to replace the current .Map - first callback function (should map column)
should return
No2
the Map function should change as follows (to work similarly as in case of AutoMapper):
...and should allow to do any kind of data manipulation from the excel value, before assigning it to the destination property (even value type changes by parsing and so)
Currently we need to match column names as find property names before we can do any extra changes... This would be maybe the first thing i'd consider to change (to pass the matched propertyname to the call)!
No3
AfterMap / BeforeMap could also help to do extra manipulation
The text was updated successfully, but these errors were encountered: