AutoMapperAssist icon indicating copy to clipboard operation
AutoMapperAssist copied to clipboard

CreateSet to reuse CreateInstance

Open sloncho opened this issue 13 years ago • 1 comments

Currently, both CreateSet and CreateInstance use mappingEngine.Map

I needed to intercept and log particular data when some mapping fails - i.e. some identifying property of the source. To get this, I had to override both methods.

If CreateSet in the select statement uses CreateInstance instead of engine.Map, the user would need to override only create instance.

The above applies if some custom stuff needs to happen for each element as well.

Please, let me know what you thing about this, and I'll create a pull request - it's just a 1 line change.

Cheers

sloncho avatar Dec 29 '11 21:12 sloncho

You are right -- let's do it. :) I'll let you do it, that will be an easy pull request to take.

darrencauthon avatar Dec 30 '11 12:12 darrencauthon