fluentsprings / ExpressMapper

Mapping .Net types
http://www.expressmapper.org
Other
310 stars 65 forks source link

Request to include flattening feature into ExpressMapper #89

Closed JonPSmith closed 8 years ago

JonPSmith commented 8 years ago

I have implemented a flattening feature for ExpressMapper, which maps nested source classes to a destination class - see #85. The main new command is .FlattenSource(), which is a command that comes after a .Register<T, TN>() command. I have also added a command called Mapper.MapExists(srcType, destType) as I need that inside the flatten and also inside my own code. I have also added a few new internal/private methods to ExpressMapper. All the new classes to implement the flattening starts with Flatten... and are all internal in scope.

I have created Unit Tests both in ExpressMapper.Tests NET4 and ExpressMapper.Tests.Projections. NOTE: This required me to do a EF data migration so you need to do run the Update-Database -ProjectName "ExpressMapper.Tests.Projections" in the PMC.

What I have NOT done is:

  1. Included the flatten classes in any other assembly than ExpressMapper NET40. I can do that, but I didn't want to get that wrong. Please let me know what you want me to do about this.
  2. I have not written the documentation. I would like to add it to the GitHub ExpressMapper Wiki, but I thought I would ask first.
anisimovyuriy commented 8 years ago

Great Job @JonPSmith ! I'll try to check it today.

Thanks, Yuriy

anisimovyuriy commented 8 years ago

Dear @JonPSmith, Great job! I'm going to merge but I'd like to make some changes from the integration point of view if you don't mind after I merge?

  1. If you don't mind I'll do it
  2. Definitely I'd be very grateful if you do it - and I'll distribute your documentation to the http://expressmapper.com
JonPSmith commented 8 years ago

Hi @ anisimovyuriy,

Great. No problem. You know your code much better than me. Be interested to see the changes. Once the PR is done then I will write the documentation in the Wiki and you can cut/paste into your docs.

Note: I have committed a final version with the failing Unit Test commented out and code inside the FlattenMapper taken out until we have figured what to do with #91.

anisimovyuriy commented 8 years ago

Thank you @JonPSmith for such great improvement for Expressmapper!

anisimovyuriy commented 8 years ago

Dear @JonPSmith,

I'd like to get in touch with you and discuss some topics in private of course if you allow me :). My email : anisimov.yuriy@gmail.com Looking forward to hearing from you.

Thanks, Yuriy