fluentsprings / ExpressMapper

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

Extend ctor support for collections #62

Closed petertiedemann closed 8 years ago

petertiedemann commented 8 years ago

This allows mapping to destination collection types that themselves have no generic type arguments, but which do implement/Inherit say IEnumerable or List.

It also clears up some code in ConvertCollection.

anisimovyuriy commented 8 years ago

Dear petertiedemann,

Thanks a lot for your pull request - really appreciated! But when I had pushed my changes with release 1.7 - I didn't pay attention if it was successful :( - completely my bad. I pushed them right now and there are some conflicts with your pull request. Would you mind to resolve them? I'd really be grateful - thanks a lot and apologies for last minute push.

Thanks, Yuriy

petertiedemann commented 8 years ago

@anisimovyuriy No problem, i have rebased it. The conflicts were related to the BCL nuget package i had to add. But after rebasing i no longer needed that commit to get it compiled.

anisimovyuriy commented 8 years ago

Could you please implement the same kind of tests as you've done above for the following destination:

  1. var result = Mapper.Map<List<TestModel>, ArrayList>( testData.Key );
  2. var result = Mapper.Map<List<TestModel>, IList>( testData.Key );
  3. var result = Mapper.Map<List<TestModel>, ICollection>( testData.Key );
  4. var result = Mapper.Map<List<TestModel>, IEnumerable>( testData.Key );

Peter I'm really appreciate what you are trying to pull off here - it's amazing support for target non-generic types!

Thanks!

Looking forward for your new changes!

Gratefully Yours, Yuriy

anisimovyuriy commented 8 years ago

Thanks a lot for your contribution!