Skip to content

Commit 83e245d

Browse files
committed
Type conversions not needed for NullLiteral (#107)
Fixed #107
1 parent 1c59ad0 commit 83e245d

12 files changed

+568
-16
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The following frameworks are supported:
3636
- net40
3737
- net45 and up
3838
- netstandard1.3
39-
- uap10.0
39+
- uap10.0 (broken in latest NuGet, sorry)
4040

4141
## Fork details
4242
This fork takes the basic library to a new level. Contains XML Documentation and examples on how to use it. Also adds unit testing to help ensure that it works properly.

System.Linq.Dynamic.Core.sln

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26730.12
4+
VisualStudioVersion = 15.0.27004.2005
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{8463ED7E-69FB-49AE-85CF-0791AFD98E38}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DBD7D9B6-FCC7-4650-91AF-E6457573A68F}"
9-
ProjectSection(SolutionItems) = preProject
10-
src\_build nuget - 2017.cmd = src\_build nuget - 2017.cmd
11-
src\_build nuget.cmd = src\_build nuget.cmd
12-
EndProjectSection
139
EndProject
1410
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{25E69107-C89E-4807-AA31-C49423F0F1E3}"
1511
ProjectSection(SolutionItems) = preProject
@@ -57,6 +53,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MemoryLeakTest", "src-conso
5753
EndProject
5854
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.NETCoreApp1.1.EntityFrameworkCore", "src-console\Test.NETCoreApp.EntityFrameworkCore\Test.NETCoreApp1.1.EntityFrameworkCore.csproj", "{F65A54BA-7C83-44DE-B67D-51065D5426F4}"
5955
EndProject
56+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QueryBug", "src-console\QueryBug\QueryBug.csproj", "{D7181F75-05F3-4D26-A5ED-B649374B43E2}"
57+
EndProject
6058
Global
6159
GlobalSection(SolutionConfigurationPlatforms) = preSolution
6260
Debug|Any CPU = Debug|Any CPU
@@ -235,6 +233,18 @@ Global
235233
{F65A54BA-7C83-44DE-B67D-51065D5426F4}.Release|x64.Build.0 = Release|Any CPU
236234
{F65A54BA-7C83-44DE-B67D-51065D5426F4}.Release|x86.ActiveCfg = Release|Any CPU
237235
{F65A54BA-7C83-44DE-B67D-51065D5426F4}.Release|x86.Build.0 = Release|Any CPU
236+
{D7181F75-05F3-4D26-A5ED-B649374B43E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
237+
{D7181F75-05F3-4D26-A5ED-B649374B43E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
238+
{D7181F75-05F3-4D26-A5ED-B649374B43E2}.Debug|x64.ActiveCfg = Debug|Any CPU
239+
{D7181F75-05F3-4D26-A5ED-B649374B43E2}.Debug|x64.Build.0 = Debug|Any CPU
240+
{D7181F75-05F3-4D26-A5ED-B649374B43E2}.Debug|x86.ActiveCfg = Debug|Any CPU
241+
{D7181F75-05F3-4D26-A5ED-B649374B43E2}.Debug|x86.Build.0 = Debug|Any CPU
242+
{D7181F75-05F3-4D26-A5ED-B649374B43E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
243+
{D7181F75-05F3-4D26-A5ED-B649374B43E2}.Release|Any CPU.Build.0 = Release|Any CPU
244+
{D7181F75-05F3-4D26-A5ED-B649374B43E2}.Release|x64.ActiveCfg = Release|Any CPU
245+
{D7181F75-05F3-4D26-A5ED-B649374B43E2}.Release|x64.Build.0 = Release|Any CPU
246+
{D7181F75-05F3-4D26-A5ED-B649374B43E2}.Release|x86.ActiveCfg = Release|Any CPU
247+
{D7181F75-05F3-4D26-A5ED-B649374B43E2}.Release|x86.Build.0 = Release|Any CPU
238248
EndGlobalSection
239249
GlobalSection(SolutionProperties) = preSolution
240250
HideSolutionNode = FALSE
@@ -254,6 +264,7 @@ Global
254264
{467B5A08-2A38-45B6-BC29-4C013B280448} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
255265
{DE991A5E-575C-4B0F-B93D-6D283E5928D6} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
256266
{F65A54BA-7C83-44DE-B67D-51065D5426F4} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
267+
{D7181F75-05F3-4D26-A5ED-B649374B43E2} = {7971CAEB-B9F2-416B-966D-2D697C4C1E62}
257268
EndGlobalSection
258269
GlobalSection(ExtensibilityGlobals) = postSolution
259270
SolutionGuid = {94C56722-194E-4B8B-BC23-B3F754E89A20}

src-console/QueryBug/Debug-01.txt

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
lambdaQuery:
2+
.Call System.Linq.Queryable.ThenBy(
3+
.Call System.Linq.Queryable.OrderBy(
4+
.Call Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.Include(
5+
.Call Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.Include(
6+
.Constant<Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[QueryBug.RootEntity]>(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[QueryBug.RootEntity]),
7+
'(.Lambda #Lambda1<System.Func`2[QueryBug.RootEntity,QueryBug.ParentEntity]>)),
8+
'(.Lambda #Lambda2<System.Func`2[QueryBug.RootEntity,System.Collections.Generic.ICollection`1[QueryBug.ChildEntity]]>))
9+
,
10+
'(.Lambda #Lambda3<System.Func`2[QueryBug.RootEntity,System.String]>)),
11+
'(.Lambda #Lambda4<System.Func`2[QueryBug.RootEntity,System.String]>))
12+
13+
.Lambda #Lambda1<System.Func`2[QueryBug.RootEntity,QueryBug.ParentEntity]>(QueryBug.RootEntity $r) {
14+
$r.ParentEntity
15+
}
16+
17+
.Lambda #Lambda2<System.Func`2[QueryBug.RootEntity,System.Collections.Generic.ICollection`1[QueryBug.ChildEntity]]>(QueryBug.RootEntity $r)
18+
{
19+
$r.Children
20+
}
21+
22+
.Lambda #Lambda3<System.Func`2[QueryBug.RootEntity,System.String]>(QueryBug.RootEntity $r) {
23+
.If ($r.ParentEntity == null) {
24+
""
25+
} .Else {
26+
($r.ParentEntity).Name
27+
}
28+
}
29+
30+
.Lambda #Lambda4<System.Func`2[QueryBug.RootEntity,System.String]>(QueryBug.RootEntity $r) {
31+
$r.Name
32+
}
33+
34+
35+
36+
dynamicQuery:
37+
.Call System.Linq.Queryable.ThenBy(
38+
.Call System.Linq.Queryable.OrderBy(
39+
.Call Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.Include(
40+
.Call Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.Include(
41+
.Constant<Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[QueryBug.RootEntity]>(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[QueryBug.RootEntity]),
42+
'(.Lambda #Lambda1<System.Func`2[QueryBug.RootEntity,QueryBug.ParentEntity]>)),
43+
'(.Lambda #Lambda2<System.Func`2[QueryBug.RootEntity,System.Collections.Generic.ICollection`1[QueryBug.ChildEntity]]>))
44+
,
45+
'(.Lambda #Lambda3<System.Func`2[QueryBug.RootEntity,System.String]>)),
46+
'(.Lambda #Lambda4<System.Func`2[QueryBug.RootEntity,System.String]>))
47+
48+
.Lambda #Lambda1<System.Func`2[QueryBug.RootEntity,QueryBug.ParentEntity]>(QueryBug.RootEntity $r) {
49+
$r.ParentEntity
50+
}
51+
52+
.Lambda #Lambda2<System.Func`2[QueryBug.RootEntity,System.Collections.Generic.ICollection`1[QueryBug.ChildEntity]]>(QueryBug.RootEntity $r)
53+
{
54+
$r.Children
55+
}
56+
57+
.Lambda #Lambda3<System.Func`2[QueryBug.RootEntity,System.String]>(QueryBug.RootEntity $var1) {
58+
.If ((System.Object)$var1.ParentEntity == null) {
59+
""
60+
} .Else {
61+
($var1.ParentEntity).Name
62+
}
63+
}
64+
65+
.Lambda #Lambda4<System.Func`2[QueryBug.RootEntity,System.String]>(QueryBug.RootEntity $var1) {
66+
$var1.Name
67+
}
68+
69+
70+
71+
castedLambdaQuery:
72+
.Call System.Linq.Queryable.ThenBy(
73+
.Call System.Linq.Queryable.OrderBy(
74+
.Call Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.Include(
75+
.Call Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.Include(
76+
.Constant<Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[QueryBug.RootEntity]>(Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[QueryBug.RootEntity]),
77+
'(.Lambda #Lambda1<System.Func`2[QueryBug.RootEntity,QueryBug.ParentEntity]>)),
78+
'(.Lambda #Lambda2<System.Func`2[QueryBug.RootEntity,System.Collections.Generic.ICollection`1[QueryBug.ChildEntity]]>))
79+
,
80+
'(.Lambda #Lambda3<System.Func`2[QueryBug.RootEntity,System.String]>)),
81+
'(.Lambda #Lambda4<System.Func`2[QueryBug.RootEntity,System.String]>))
82+
83+
.Lambda #Lambda1<System.Func`2[QueryBug.RootEntity,QueryBug.ParentEntity]>(QueryBug.RootEntity $r) {
84+
$r.ParentEntity
85+
}
86+
87+
.Lambda #Lambda2<System.Func`2[QueryBug.RootEntity,System.Collections.Generic.ICollection`1[QueryBug.ChildEntity]]>(QueryBug.RootEntity $r)
88+
{
89+
$r.Children
90+
}
91+
92+
.Lambda #Lambda3<System.Func`2[QueryBug.RootEntity,System.String]>(QueryBug.RootEntity $r) {
93+
.If ((System.Object)$r.ParentEntity == null) {
94+
""
95+
} .Else {
96+
($r.ParentEntity).Name
97+
}
98+
}
99+
100+
.Lambda #Lambda4<System.Func`2[QueryBug.RootEntity,System.String]>(QueryBug.RootEntity $r) {
101+
$r.Name
102+
}

src-console/QueryBug/Migrations/20171027155451_Init.Designer.cs

+82
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
using Microsoft.EntityFrameworkCore.Metadata;
2+
using Microsoft.EntityFrameworkCore.Migrations;
3+
using System;
4+
using System.Collections.Generic;
5+
6+
namespace QueryBug.Migrations
7+
{
8+
public partial class Init : Migration
9+
{
10+
protected override void Up(MigrationBuilder migrationBuilder)
11+
{
12+
migrationBuilder.CreateTable(
13+
name: "ParentEntities",
14+
columns: table => new
15+
{
16+
ParentEntityId = table.Column<int>(type: "int", nullable: false)
17+
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
18+
Name = table.Column<string>(type: "nvarchar(max)", nullable: true)
19+
},
20+
constraints: table =>
21+
{
22+
table.PrimaryKey("PK_ParentEntities", x => x.ParentEntityId);
23+
});
24+
25+
migrationBuilder.CreateTable(
26+
name: "RootEntities",
27+
columns: table => new
28+
{
29+
RootEntityId = table.Column<int>(type: "int", nullable: false)
30+
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
31+
Name = table.Column<string>(type: "nvarchar(max)", nullable: true),
32+
ParentEntityId = table.Column<int>(type: "int", nullable: true)
33+
},
34+
constraints: table =>
35+
{
36+
table.PrimaryKey("PK_RootEntities", x => x.RootEntityId);
37+
table.ForeignKey(
38+
name: "FK_RootEntities_ParentEntities_ParentEntityId",
39+
column: x => x.ParentEntityId,
40+
principalTable: "ParentEntities",
41+
principalColumn: "ParentEntityId",
42+
onDelete: ReferentialAction.Restrict);
43+
});
44+
45+
migrationBuilder.CreateTable(
46+
name: "ChildEntities",
47+
columns: table => new
48+
{
49+
ChildEntityId = table.Column<int>(type: "int", nullable: false)
50+
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
51+
RootEntityId = table.Column<int>(type: "int", nullable: false)
52+
},
53+
constraints: table =>
54+
{
55+
table.PrimaryKey("PK_ChildEntities", x => x.ChildEntityId);
56+
table.ForeignKey(
57+
name: "FK_ChildEntities_RootEntities_RootEntityId",
58+
column: x => x.RootEntityId,
59+
principalTable: "RootEntities",
60+
principalColumn: "RootEntityId",
61+
onDelete: ReferentialAction.Cascade);
62+
});
63+
64+
migrationBuilder.CreateIndex(
65+
name: "IX_ChildEntities_RootEntityId",
66+
table: "ChildEntities",
67+
column: "RootEntityId");
68+
69+
migrationBuilder.CreateIndex(
70+
name: "IX_RootEntities_ParentEntityId",
71+
table: "RootEntities",
72+
column: "ParentEntityId");
73+
}
74+
75+
protected override void Down(MigrationBuilder migrationBuilder)
76+
{
77+
migrationBuilder.DropTable(
78+
name: "ChildEntities");
79+
80+
migrationBuilder.DropTable(
81+
name: "RootEntities");
82+
83+
migrationBuilder.DropTable(
84+
name: "ParentEntities");
85+
}
86+
}
87+
}

0 commit comments

Comments
 (0)