diff --git a/src/AutoMapper.Collection.EntityFramework.Tests/AutoMapper.Collection.EntityFramework.Tests.csproj b/src/AutoMapper.Collection.EntityFramework.Tests/AutoMapper.Collection.EntityFramework.Tests.csproj index b54da62..da0d9be 100644 --- a/src/AutoMapper.Collection.EntityFramework.Tests/AutoMapper.Collection.EntityFramework.Tests.csproj +++ b/src/AutoMapper.Collection.EntityFramework.Tests/AutoMapper.Collection.EntityFramework.Tests.csproj @@ -30,9 +30,8 @@ 4 - - ..\..\packages\AutoMapper.6.0.0\lib\net45\AutoMapper.dll - True + + ..\..\packages\AutoMapper.6.2.1\lib\net45\AutoMapper.dll ..\..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll diff --git a/src/AutoMapper.Collection.EntityFramework.Tests/MapCollectionWithEqualityTests.cs b/src/AutoMapper.Collection.EntityFramework.Tests/MapCollectionWithEqualityTests.cs index 4060907..96336b8 100644 --- a/src/AutoMapper.Collection.EntityFramework.Tests/MapCollectionWithEqualityTests.cs +++ b/src/AutoMapper.Collection.EntityFramework.Tests/MapCollectionWithEqualityTests.cs @@ -12,6 +12,7 @@ public class MapCollectionWithEqualityTests { public MapCollectionWithEqualityTests() { + Mapper.Reset(); Mapper.Initialize(x => { x.AddCollectionMappers(); @@ -68,6 +69,7 @@ public void Should_Work_With_Null_Destination() public void Should_Be_Instanced_Based() { + Mapper.Reset(); Mapper.Initialize(x => { x.AddCollectionMappers(); diff --git a/src/AutoMapper.Collection.EntityFramework.Tests/packages.config b/src/AutoMapper.Collection.EntityFramework.Tests/packages.config index 28a3ef6..af1430c 100644 --- a/src/AutoMapper.Collection.EntityFramework.Tests/packages.config +++ b/src/AutoMapper.Collection.EntityFramework.Tests/packages.config @@ -1,6 +1,6 @@  - + diff --git a/src/AutoMapper.Collection.Tests/AutoMapper.Collection.Tests.csproj b/src/AutoMapper.Collection.Tests/AutoMapper.Collection.Tests.csproj index 300ba82..bc8c5cd 100644 --- a/src/AutoMapper.Collection.Tests/AutoMapper.Collection.Tests.csproj +++ b/src/AutoMapper.Collection.Tests/AutoMapper.Collection.Tests.csproj @@ -30,9 +30,8 @@ 4 - - ..\..\packages\AutoMapper.6.0.0\lib\net45\AutoMapper.dll - True + + ..\..\packages\AutoMapper.6.2.1\lib\net45\AutoMapper.dll ..\..\packages\Fixie.1.0.2\lib\net45\Fixie.dll diff --git a/src/AutoMapper.Collection.Tests/MapCollectionWithEqualityTests.cs b/src/AutoMapper.Collection.Tests/MapCollectionWithEqualityTests.cs index 4ce1c33..3d5de6d 100644 --- a/src/AutoMapper.Collection.Tests/MapCollectionWithEqualityTests.cs +++ b/src/AutoMapper.Collection.Tests/MapCollectionWithEqualityTests.cs @@ -10,6 +10,7 @@ public class MapCollectionWithEqualityTests { public MapCollectionWithEqualityTests() { + Mapper.Reset(); Mapper.Initialize(x => { x.AddCollectionMappers(); @@ -72,6 +73,7 @@ public void Should_Be_Fast_With_Large_Reversed_Lists() public void Should_Be_Fast_With_Large_Lists_MultiProperty_Mapping() { + Mapper.Reset(); Mapper.Initialize(x => { x.AddCollectionMappers(); @@ -87,6 +89,7 @@ public void Should_Be_Fast_With_Large_Lists_MultiProperty_Mapping() public void Should_Be_Fast_With_Large_Lists_MultiProperty_Mapping_Cant_Extract() { + Mapper.Reset(); Mapper.Initialize(x => { x.AddCollectionMappers(); @@ -102,6 +105,7 @@ public void Should_Be_Fast_With_Large_Lists_MultiProperty_Mapping_Cant_Extract() public void Should_Be_Fast_With_Large_Lists_Cant_Extract_Negative() { + Mapper.Reset(); Mapper.Initialize(x => { x.AddCollectionMappers(); @@ -118,6 +122,7 @@ public void Should_Be_Fast_With_Large_Lists_Cant_Extract_Negative() public void Should_Be_Fast_With_Large_Lists_MultiProperty_Mapping_Cant_Extract_Negative() { + Mapper.Reset(); Mapper.Initialize(x => { x.AddCollectionMappers(); @@ -134,6 +139,7 @@ public void Should_Be_Fast_With_Large_Lists_MultiProperty_Mapping_Cant_Extract_N public void Should_Be_Fast_With_Large_Lists_SubObject() { + Mapper.Reset(); Mapper.Initialize(x => { x.AddCollectionMappers(); @@ -149,6 +155,7 @@ public void Should_Be_Fast_With_Large_Lists_SubObject() public void Should_Be_Fast_With_Large_Lists_SubObject_WrongCollectionType_Should_Throw() { + Mapper.Reset(); Mapper.Initialize(x => { x.AddCollectionMappers(); @@ -165,6 +172,7 @@ public void Should_Be_Fast_With_Large_Lists_SubObject_WrongCollectionType_Should public void Should_Work_With_Conditionals() { + Mapper.Reset(); Mapper.Initialize(cfg => { cfg.AddCollectionMappers(); @@ -212,6 +220,7 @@ public void Should_Work_With_Null_Destination() public void Should_Work_With_Comparing_String_Types() { + Mapper.Reset(); Mapper.Initialize(cfg => { cfg.AddCollectionMappers(); @@ -290,6 +299,7 @@ public class SaleCharge public void Should_Be_Instanced_Based() { + Mapper.Reset(); Mapper.Initialize(x => { x.AddCollectionMappers(); diff --git a/src/AutoMapper.Collection.Tests/packages.config b/src/AutoMapper.Collection.Tests/packages.config index d3560d6..b6dd6ba 100644 --- a/src/AutoMapper.Collection.Tests/packages.config +++ b/src/AutoMapper.Collection.Tests/packages.config @@ -1,6 +1,6 @@  - + diff --git a/src/AutoMapper.Collection/AutoMapper.Collection.csproj b/src/AutoMapper.Collection/AutoMapper.Collection.csproj index 9e12313..ac78ba7 100644 --- a/src/AutoMapper.Collection/AutoMapper.Collection.csproj +++ b/src/AutoMapper.Collection/AutoMapper.Collection.csproj @@ -17,7 +17,7 @@ - + @@ -25,12 +25,4 @@ - - - - - - - - diff --git a/src/AutoMapper.Collection/Mappers/EquivalentExpressionAddRemoveCollectionMapper.cs b/src/AutoMapper.Collection/Mappers/EquivalentExpressionAddRemoveCollectionMapper.cs index 5291111..5b10a31 100644 --- a/src/AutoMapper.Collection/Mappers/EquivalentExpressionAddRemoveCollectionMapper.cs +++ b/src/AutoMapper.Collection/Mappers/EquivalentExpressionAddRemoveCollectionMapper.cs @@ -81,7 +81,7 @@ public Expression MapExpression(IConfigurationProvider configurationProvider, Pr sourceExpression, destExpression, contextExpression, Constant(EquivalencyExpression)); var collectionMap = CollectionMapper.MapExpression(configurationProvider, profileMap, propertyMap, sourceExpression, destExpression, contextExpression); - return Condition(notNull, map, collectionMap); + return Condition(notNull, map, Convert(collectionMap, destExpression.Type)); } } }