Skip to content

Commit 4ae77b6

Browse files
committed
Fixing tuple issue
1 parent 0f6a19d commit 4ae77b6

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/UnitTests/AutoMapper.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
<PackageReference Include="xunit" Version="2.9.2" />
2020
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" PrivateAssets="All" />
2121
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
22+
<PackageReference Include="Microsoft.Bcl.HashCode" Version="[6.0.0, )" Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'net471'" />
23+
<PackageReference Include="System.ValueTuple" Version="4.6.1" Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'net471'" />
24+
<PackageReference Include="System.Reflection.Emit" Version="[4.7.0, )" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
25+
<PackageReference Include="PolySharp" Version="1.15.0" Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'net471'" PrivateAssets="All" />
2226
</ItemGroup>
2327
<ItemGroup>
2428
<Using Include="Xunit" />

src/UnitTests/Bug/MultiThreadingIssues.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,11 @@ public async Task Should_work()
642642
var tasks =
643643
types
644644
.Concat(types.Select(t => t.Reverse().ToArray()))
645-
.Select(t=>(SourceType: sourceType.MakeGenericType(t[0]), DestinationType: destinationType.MakeGenericType(t[1])))
645+
.Select(t=> new
646+
{
647+
SourceType = sourceType.MakeGenericType(t[0]),
648+
DestinationType = destinationType.MakeGenericType(t[1])
649+
})
646650
.ToArray()
647651
.Select(s => Task.Factory.StartNew(() => c.ResolveTypeMap(s.SourceType, s.DestinationType)))
648652
.ToArray();
@@ -1174,7 +1178,11 @@ public async Task Should_work()
11741178
var tasks =
11751179
types
11761180
.Concat(types.Select(t => t.Reverse().ToArray()))
1177-
.Select(t=>(SourceType: sourceType.MakeGenericType(t[0]), DestinationType: destinationType.MakeGenericType(t[1])))
1181+
.Select(t=> new
1182+
{
1183+
SourceType = sourceType.MakeGenericType(t[0]),
1184+
DestinationType = destinationType.MakeGenericType(t[1])
1185+
})
11781186
.ToArray()
11791187
.Select(s => Task.Factory.StartNew(() => mapper.Map(null, s.SourceType, s.DestinationType)))
11801188
.ToArray();

0 commit comments

Comments
 (0)