Skip to content

Commit 748c523

Browse files
committed
Using NetStandardPolyfills to access reflection members
1 parent f4cf94f commit 748c523

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

ReadableExpressions.UnitTests/ReadableExpressions.UnitTests.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
<WarningLevel>4</WarningLevel>
3636
</PropertyGroup>
3737
<ItemGroup>
38+
<Reference Include="AgileObjects.NetStandardPolyfills, Version=1.0.0.0, Culture=neutral, PublicKeyToken=06131ac1c008ad4e, processorArchitecture=MSIL">
39+
<HintPath>..\packages\AgileObjects.NetStandardPolyfills.1.0.0\lib\net40\AgileObjects.NetStandardPolyfills.dll</HintPath>
40+
</Reference>
3841
<Reference Include="Microsoft.CSharp" />
3942
<Reference Include="System" />
4043
<Reference Include="System.Data" />
@@ -91,6 +94,9 @@
9194
<Name>ReadableExpressions</Name>
9295
</ProjectReference>
9396
</ItemGroup>
97+
<ItemGroup>
98+
<None Include="packages.config" />
99+
</ItemGroup>
94100
<Choose>
95101
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
96102
<ItemGroup>

ReadableExpressions.UnitTests/WhenTranslatingBlocks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void ShouldTranslateAVariableBlockLambdaWithAReturnExpression()
136136

137137
var listAssignment = Expression.Assign(listVariable, createList.Body);
138138

139-
var toArrayMethod = typeof(Enumerable).GetMethod("ToArray");
139+
var toArrayMethod = typeof(Enumerable).GetPublicStaticMethod("ToArray");
140140
var typedToArrayMethod = toArrayMethod.MakeGenericMethod(typeof(int));
141141
var listToArray = Expression.Call(typedToArrayMethod, listVariable);
142142

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="AgileObjects.NetStandardPolyfills" version="1.0.0" targetFramework="net45" />
4+
</packages>

0 commit comments

Comments
 (0)