Skip to content

Commit 3d95b06

Browse files
Fix unit test project caused by pull #399 and allow parse double
Fix unit test project caused by pull #399 and allow parse double
1 parent 02910bd commit 3d95b06

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/System.Linq.Dynamic.Core/Parser/ExpressionPromoter.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public virtual Expression Promote(Expression expr, Type type, bool exact, bool c
6060
break;
6161

6262
case TypeCode.Double:
63-
if (target == typeof(decimal)) value = _numberParser.ParseNumber(text, target);
63+
if (target == typeof(decimal) || target == typeof(double)) value = _numberParser.ParseNumber(text, target);
6464
break;
6565

6666
case TypeCode.String:
@@ -80,7 +80,7 @@ public virtual Expression Promote(Expression expr, Type type, bool exact, bool c
8080
}
8181
else if (ce.Type == typeof(double))
8282
{
83-
if (target == typeof(decimal))
83+
if (target == typeof(decimal) || target == typeof(double))
8484
{
8585
value = _numberParser.ParseNumber(text, target);
8686
}

test/EntityFramework.DynamicLinq.Tests.net452/EntityFramework.DynamicLinq.Tests.net452.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<DebugType>full</DebugType>
2222
<Optimize>false</Optimize>
2323
<OutputPath>bin\Debug\</OutputPath>
24-
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<DefineConstants>DEBUG;TRACE;NET452</DefineConstants>
2525
<ErrorReport>prompt</ErrorReport>
2626
<WarningLevel>4</WarningLevel>
2727
</PropertyGroup>

test/EntityFramework.DynamicLinq.Tests/EntityFramework.DynamicLinq.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Authors>Stef Heyenrath</Authors>
55
<TargetFramework>net461</TargetFramework>
6-
<DefineConstants>EF</DefineConstants>
6+
<DefineConstants>EF;NET461</DefineConstants>
77
<AssemblyName>EntityFramework.DynamicLinq.Tests</AssemblyName>
88
<PackageId>EntityFramework.DynamicLinq.Tests</PackageId>
99
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>

test/System.Linq.Dynamic.Core.Tests/TestHelpers/ExpressionString.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static class ExpressionString
1010
{
1111
public static string NullableConversion(string convertedExpr)
1212
{
13-
#if NET452
13+
#if NET452 || NET461
1414
return $"Convert({convertedExpr})";
1515
#else
1616
return $"Convert({convertedExpr}, Nullable`1)";

0 commit comments

Comments
 (0)