自动贪婪加载 LeftJoin/InnerJoin/RightJoin 数据

This commit is contained in:
2881099
2019-04-20 01:21:57 +08:00
parent 6c64eac419
commit 191a15fb42
3 changed files with 141 additions and 14 deletions

View File

@ -10,17 +10,17 @@ namespace FreeSql.Tests.Sqlite {
public class SqliteCodeFirstTest {
class Topic {
public class Topic {
public Guid Id { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public DateTime CreateTime { get; set; }
}
[Table(Name = "xxxtb.Comment")]
class Comment {
public class Comment {
public Guid Id { get; set; }
public Guid TopicId { get; set; }
public Topic Topic { get; set; }
public virtual Topic Topic { get; set; }
public string Nickname { get; set; }
public string Content { get; set; }
public DateTime CreateTime { get; set; }

View File

@ -54,6 +54,10 @@ 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();
Expression<Func<TestInfo, object>> orderBy = null;
orderBy = a => a.CreateTime;
var testsql1 = select.OrderBy(orderBy).ToSql();