Skip to content

Commit 58b5199

Browse files
Merge pull request #66 from Tasteful/6.2Compatibility
Work against 6.2.x
2 parents d0e81c7 + 3e34703 commit 58b5199

File tree

8 files changed

+20
-18
lines changed

8 files changed

+20
-18
lines changed

src/AutoMapper.Collection.EntityFramework.Tests/AutoMapper.Collection.EntityFramework.Tests.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@
3030
<WarningLevel>4</WarningLevel>
3131
</PropertyGroup>
3232
<ItemGroup>
33-
<Reference Include="AutoMapper, Version=0.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
34-
<HintPath>..\..\packages\AutoMapper.6.0.0\lib\net45\AutoMapper.dll</HintPath>
35-
<Private>True</Private>
33+
<Reference Include="AutoMapper, Version=6.2.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
34+
<HintPath>..\..\packages\AutoMapper.6.2.1\lib\net45\AutoMapper.dll</HintPath>
3635
</Reference>
3736
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
3837
<HintPath>..\..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>

src/AutoMapper.Collection.EntityFramework.Tests/MapCollectionWithEqualityTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class MapCollectionWithEqualityTests
1212
{
1313
public MapCollectionWithEqualityTests()
1414
{
15+
Mapper.Reset();
1516
Mapper.Initialize(x =>
1617
{
1718
x.AddCollectionMappers();
@@ -68,6 +69,7 @@ public void Should_Work_With_Null_Destination()
6869

6970
public void Should_Be_Instanced_Based()
7071
{
72+
Mapper.Reset();
7173
Mapper.Initialize(x =>
7274
{
7375
x.AddCollectionMappers();

src/AutoMapper.Collection.EntityFramework.Tests/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="AutoMapper" version="6.0.0" targetFramework="net45" />
3+
<package id="AutoMapper" version="6.2.1" targetFramework="net45" />
44
<package id="EntityFramework" version="6.1.3" targetFramework="net45" />
55
<package id="Fixie" version="1.0.2" targetFramework="net45" />
66
<package id="FluentAssertions" version="4.15.0" targetFramework="net45" />

src/AutoMapper.Collection.Tests/AutoMapper.Collection.Tests.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@
3030
<WarningLevel>4</WarningLevel>
3131
</PropertyGroup>
3232
<ItemGroup>
33-
<Reference Include="AutoMapper, Version=0.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
34-
<HintPath>..\..\packages\AutoMapper.6.0.0\lib\net45\AutoMapper.dll</HintPath>
35-
<Private>True</Private>
33+
<Reference Include="AutoMapper, Version=6.2.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
34+
<HintPath>..\..\packages\AutoMapper.6.2.1\lib\net45\AutoMapper.dll</HintPath>
3635
</Reference>
3736
<Reference Include="Fixie, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
3837
<HintPath>..\..\packages\Fixie.1.0.2\lib\net45\Fixie.dll</HintPath>

src/AutoMapper.Collection.Tests/MapCollectionWithEqualityTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class MapCollectionWithEqualityTests
1010
{
1111
public MapCollectionWithEqualityTests()
1212
{
13+
Mapper.Reset();
1314
Mapper.Initialize(x =>
1415
{
1516
x.AddCollectionMappers();
@@ -72,6 +73,7 @@ public void Should_Be_Fast_With_Large_Reversed_Lists()
7273

7374
public void Should_Be_Fast_With_Large_Lists_MultiProperty_Mapping()
7475
{
76+
Mapper.Reset();
7577
Mapper.Initialize(x =>
7678
{
7779
x.AddCollectionMappers();
@@ -87,6 +89,7 @@ public void Should_Be_Fast_With_Large_Lists_MultiProperty_Mapping()
8789

8890
public void Should_Be_Fast_With_Large_Lists_MultiProperty_Mapping_Cant_Extract()
8991
{
92+
Mapper.Reset();
9093
Mapper.Initialize(x =>
9194
{
9295
x.AddCollectionMappers();
@@ -102,6 +105,7 @@ public void Should_Be_Fast_With_Large_Lists_MultiProperty_Mapping_Cant_Extract()
102105

103106
public void Should_Be_Fast_With_Large_Lists_Cant_Extract_Negative()
104107
{
108+
Mapper.Reset();
105109
Mapper.Initialize(x =>
106110
{
107111
x.AddCollectionMappers();
@@ -118,6 +122,7 @@ public void Should_Be_Fast_With_Large_Lists_Cant_Extract_Negative()
118122

119123
public void Should_Be_Fast_With_Large_Lists_MultiProperty_Mapping_Cant_Extract_Negative()
120124
{
125+
Mapper.Reset();
121126
Mapper.Initialize(x =>
122127
{
123128
x.AddCollectionMappers();
@@ -134,6 +139,7 @@ public void Should_Be_Fast_With_Large_Lists_MultiProperty_Mapping_Cant_Extract_N
134139

135140
public void Should_Be_Fast_With_Large_Lists_SubObject()
136141
{
142+
Mapper.Reset();
137143
Mapper.Initialize(x =>
138144
{
139145
x.AddCollectionMappers();
@@ -149,6 +155,7 @@ public void Should_Be_Fast_With_Large_Lists_SubObject()
149155

150156
public void Should_Be_Fast_With_Large_Lists_SubObject_WrongCollectionType_Should_Throw()
151157
{
158+
Mapper.Reset();
152159
Mapper.Initialize(x =>
153160
{
154161
x.AddCollectionMappers();
@@ -165,6 +172,7 @@ public void Should_Be_Fast_With_Large_Lists_SubObject_WrongCollectionType_Should
165172

166173
public void Should_Work_With_Conditionals()
167174
{
175+
Mapper.Reset();
168176
Mapper.Initialize(cfg =>
169177
{
170178
cfg.AddCollectionMappers();
@@ -212,6 +220,7 @@ public void Should_Work_With_Null_Destination()
212220

213221
public void Should_Work_With_Comparing_String_Types()
214222
{
223+
Mapper.Reset();
215224
Mapper.Initialize(cfg =>
216225
{
217226
cfg.AddCollectionMappers();
@@ -290,6 +299,7 @@ public class SaleCharge
290299

291300
public void Should_Be_Instanced_Based()
292301
{
302+
Mapper.Reset();
293303
Mapper.Initialize(x =>
294304
{
295305
x.AddCollectionMappers();

src/AutoMapper.Collection.Tests/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="AutoMapper" version="6.0.0" targetFramework="net45" />
3+
<package id="AutoMapper" version="6.2.1" targetFramework="net45" />
44
<package id="Fixie" version="1.0.2" targetFramework="net45" />
55
<package id="FluentAssertions" version="4.15.0" targetFramework="net45" />
66
<package id="System.ValueTuple" version="4.3.0" targetFramework="net45" />

src/AutoMapper.Collection/AutoMapper.Collection.csproj

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,12 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="AutoMapper" Version="6.0.0" />
20+
<PackageReference Include="AutoMapper" Version="6.2.1" />
2121
</ItemGroup>
2222

2323
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
2424
<Reference Include="System" />
2525
<Reference Include="Microsoft.CSharp" />
2626
</ItemGroup>
2727

28-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.1' ">
29-
<PackageReference Include="System.Threading" Version="4.0.11" />
30-
</ItemGroup>
31-
32-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
33-
<PackageReference Include="System.Threading" Version="4.0.11" />
34-
</ItemGroup>
35-
3628
</Project>

src/AutoMapper.Collection/Mappers/EquivalentExpressionAddRemoveCollectionMapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public Expression MapExpression(IConfigurationProvider configurationProvider, Pr
8181
sourceExpression, destExpression, contextExpression, Constant(EquivalencyExpression));
8282
var collectionMap = CollectionMapper.MapExpression(configurationProvider, profileMap, propertyMap, sourceExpression, destExpression, contextExpression);
8383

84-
return Condition(notNull, map, collectionMap);
84+
return Condition(notNull, map, Convert(collectionMap, destExpression.Type));
8585
}
8686
}
8787
}

0 commit comments

Comments
 (0)