From e4224c9a741c45171801d7fd3c47b30b63527cba Mon Sep 17 00:00:00 2001 From: Tyler Carlson Date: Tue, 21 Nov 2017 22:09:10 -0600 Subject: [PATCH 1/3] Work against 6.2.x --- .../AutoMapper.Collection.EntityFramework.Tests.csproj | 6 +++--- .../MapCollectionWithEqualityTests.cs | 2 ++ .../packages.config | 2 +- .../AutoMapper.Collection.Tests.csproj | 6 +++--- .../MapCollectionWithEqualityTests.cs | 10 ++++++++++ src/AutoMapper.Collection.Tests/packages.config | 2 +- src/AutoMapper.Collection/AutoMapper.Collection.csproj | 2 +- .../EquivalentExpressionAddRemoveCollectionMapper.cs | 2 +- 8 files changed, 22 insertions(+), 10 deletions(-) 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..8b27066 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 @@ -57,6 +56,7 @@ + ..\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll True 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..7fa18b8 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 @@ -48,6 +47,7 @@ + ..\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll True 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..b283fbd 100644 --- a/src/AutoMapper.Collection/AutoMapper.Collection.csproj +++ b/src/AutoMapper.Collection/AutoMapper.Collection.csproj @@ -17,7 +17,7 @@ - + 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)); } } } From 26ec848e8bec4575adc10449dc3679110fa55e84 Mon Sep 17 00:00:00 2001 From: Tyler Carlson Date: Tue, 21 Nov 2017 22:15:34 -0600 Subject: [PATCH 2/3] remove refs --- .../AutoMapper.Collection.EntityFramework.Tests.csproj | 1 - .../AutoMapper.Collection.Tests.csproj | 1 - 2 files changed, 2 deletions(-) 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 8b27066..da0d9be 100644 --- a/src/AutoMapper.Collection.EntityFramework.Tests/AutoMapper.Collection.EntityFramework.Tests.csproj +++ b/src/AutoMapper.Collection.EntityFramework.Tests/AutoMapper.Collection.EntityFramework.Tests.csproj @@ -56,7 +56,6 @@ - ..\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll True diff --git a/src/AutoMapper.Collection.Tests/AutoMapper.Collection.Tests.csproj b/src/AutoMapper.Collection.Tests/AutoMapper.Collection.Tests.csproj index 7fa18b8..bc8c5cd 100644 --- a/src/AutoMapper.Collection.Tests/AutoMapper.Collection.Tests.csproj +++ b/src/AutoMapper.Collection.Tests/AutoMapper.Collection.Tests.csproj @@ -47,7 +47,6 @@ - ..\..\packages\System.ValueTuple.4.3.0\lib\netstandard1.0\System.ValueTuple.dll True From 3e34703093a119c0086883a6e73832d57e9500eb Mon Sep 17 00:00:00 2001 From: Patric Forsgard Date: Mon, 27 Nov 2017 11:44:37 +0100 Subject: [PATCH 3/3] Remove directly reference to System.Threading --- src/AutoMapper.Collection/AutoMapper.Collection.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/AutoMapper.Collection/AutoMapper.Collection.csproj b/src/AutoMapper.Collection/AutoMapper.Collection.csproj index b283fbd..ac78ba7 100644 --- a/src/AutoMapper.Collection/AutoMapper.Collection.csproj +++ b/src/AutoMapper.Collection/AutoMapper.Collection.csproj @@ -25,12 +25,4 @@ - - - - - - - -