Skip to content

Commit fd04042

Browse files
committed
test
1 parent 191a15f commit fd04042

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

FreeSql.Tests/FreeSql.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="FreeSql.Repository" Version="0.4.11" />
1110
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
1211
<PackageReference Include="xunit" Version="2.4.0" />
1312
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
1413
</ItemGroup>
1514

1615
<ItemGroup>
16+
<ProjectReference Include="..\..\FreeSql.DbContext\FreeSql.DbContext\FreeSql.DbContext.csproj" />
1717
<ProjectReference Include="..\FreeSql\FreeSql.csproj" />
1818
</ItemGroup>
1919

FreeSql.Tests/UnitTest1.cs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,28 @@ class ServiceRequestNew {
5454
[Fact]
5555
public void Test1() {
5656

57-
var sql = g.sqlite.Select<TestTypeParentInfo>().Where(a => a.Parent.Parent.Parent.Name == "11").ToSql();
58-
var sql222 = g.sqlite.Select<TestTypeParentInfo>().Where(a => a.Parent.Parent.Parent.Name == "11").ToList();
57+
var sqlrepos = g.sqlite.GetRepository<TestTypeParentInfo, int>();
58+
sqlrepos.Insert(new TestTypeParentInfo {
59+
Name = "testroot",
60+
Childs = new[] {
61+
new TestTypeParentInfo {
62+
Name = "testpath2",
63+
Childs = new[] {
64+
new TestTypeParentInfo {
65+
Name = "testpath3",
66+
Childs = new[] {
67+
new TestTypeParentInfo {
68+
Name = "11"
69+
}
70+
}
71+
}
72+
}
73+
}
74+
}
75+
});
76+
77+
var sql = g.sqlite.Select<TestTypeParentInfo>().Where(a => a.Parent.Parent.Parent.Name == "testroot").ToSql();
78+
var sql222 = g.sqlite.Select<TestTypeParentInfo>().Where(a => a.Parent.Parent.Parent.Name == "testroot").ToList();
5979

6080

6181
Expression<Func<TestInfo, object>> orderBy = null;
@@ -336,11 +356,13 @@ class TestTypeInfo {
336356
}
337357

338358
class TestTypeParentInfo {
359+
[Column(IsIdentity = true)]
339360
public int Id { get; set; }
340361
public string Name { get; set; }
341362

342363
public int ParentId { get; set; }
343364
public TestTypeParentInfo Parent { get; set; }
365+
public ICollection<TestTypeParentInfo> Childs { get; set; }
344366

345367
public List<TestTypeInfo> Types { get; set; }
346368
}

FreeSql.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "efcore_to_freesql", "Exampl
2424
EndProject
2525
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "orm_vs", "Examples\orm_vs\orm_vs.csproj", "{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}"
2626
EndProject
27+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FreeSql.DbContext", "..\FreeSql.DbContext\FreeSql.DbContext\FreeSql.DbContext.csproj", "{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}"
28+
EndProject
2729
Global
2830
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2931
Debug|Any CPU = Debug|Any CPU
@@ -118,6 +120,18 @@ Global
118120
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Release|x64.Build.0 = Release|Any CPU
119121
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Release|x86.ActiveCfg = Release|Any CPU
120122
{1A5EC2EB-8C2B-4547-8AC6-EB5C0DE0CA81}.Release|x86.Build.0 = Release|Any CPU
123+
{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
124+
{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
125+
{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}.Debug|x64.ActiveCfg = Debug|Any CPU
126+
{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}.Debug|x64.Build.0 = Debug|Any CPU
127+
{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}.Debug|x86.ActiveCfg = Debug|Any CPU
128+
{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}.Debug|x86.Build.0 = Debug|Any CPU
129+
{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
130+
{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}.Release|Any CPU.Build.0 = Release|Any CPU
131+
{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}.Release|x64.ActiveCfg = Release|Any CPU
132+
{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}.Release|x64.Build.0 = Release|Any CPU
133+
{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}.Release|x86.ActiveCfg = Release|Any CPU
134+
{56488C60-FF2C-47ED-B6DD-A38D3CFB84FB}.Release|x86.Build.0 = Release|Any CPU
121135
EndGlobalSection
122136
GlobalSection(SolutionProperties) = preSolution
123137
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)