mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
test
This commit is contained in:
@ -7,13 +7,13 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FreeSql.Repository" Version="0.4.11" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\FreeSql.DbContext\FreeSql.DbContext\FreeSql.DbContext.csproj" />
|
||||
<ProjectReference Include="..\FreeSql\FreeSql.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -54,8 +54,28 @@ namespace FreeSql.Tests {
|
||||
[Fact]
|
||||
public void Test1() {
|
||||
|
||||
var sql = g.sqlite.Select<TestTypeParentInfo>().Where(a => a.Parent.Parent.Parent.Name == "11").ToSql();
|
||||
var sql222 = g.sqlite.Select<TestTypeParentInfo>().Where(a => a.Parent.Parent.Parent.Name == "11").ToList();
|
||||
var sqlrepos = g.sqlite.GetRepository<TestTypeParentInfo, int>();
|
||||
sqlrepos.Insert(new TestTypeParentInfo {
|
||||
Name = "testroot",
|
||||
Childs = new[] {
|
||||
new TestTypeParentInfo {
|
||||
Name = "testpath2",
|
||||
Childs = new[] {
|
||||
new TestTypeParentInfo {
|
||||
Name = "testpath3",
|
||||
Childs = new[] {
|
||||
new TestTypeParentInfo {
|
||||
Name = "11"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var sql = g.sqlite.Select<TestTypeParentInfo>().Where(a => a.Parent.Parent.Parent.Name == "testroot").ToSql();
|
||||
var sql222 = g.sqlite.Select<TestTypeParentInfo>().Where(a => a.Parent.Parent.Parent.Name == "testroot").ToList();
|
||||
|
||||
|
||||
Expression<Func<TestInfo, object>> orderBy = null;
|
||||
@ -336,11 +356,13 @@ namespace FreeSql.Tests {
|
||||
}
|
||||
|
||||
class TestTypeParentInfo {
|
||||
[Column(IsIdentity = true)]
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public int ParentId { get; set; }
|
||||
public TestTypeParentInfo Parent { get; set; }
|
||||
public ICollection<TestTypeParentInfo> Childs { get; set; }
|
||||
|
||||
public List<TestTypeInfo> Types { get; set; }
|
||||
}
|
||||
|
Reference in New Issue
Block a user