- 修复 ToList((a,b) => new { a, b }) 当 b 为 null 的时候,应该整个 b 为 null;(导航属性没这个问题)

This commit is contained in:
28810
2019-12-10 16:35:11 +08:00
parent d8fd20b8f9
commit 82376eecb4
4 changed files with 51 additions and 11 deletions

View File

@ -227,9 +227,41 @@ namespace FreeSql.Tests
public decimal rowstate { get; set; }
}
public class otot1
{
[Column(IsIdentity = true)]
public int id { get; set; }
public string name { get; set; }
public otot2 t2 { get; set; }
}
public class otot2
{
[Column(IsIdentity = true)]
public int id { get; set; }
public string title { get; set; }
}
[Fact]
public void Test02()
{
g.sqlite.Insert(new otot1 { name = "otot1_name1" }).ExecuteAffrows();
var otolst1 = g.sqlite.Select<otot1>()
.LeftJoin(a => a.id == a.t2.id)
.ToList();
var otolst2 = g.sqlite.Select<otot1, otot2>()
.LeftJoin((a, b) => a.id == b.id)
.ToList((a, b) => new
{
a,
b
});
var testcf = g.sqlite.CodeFirst.GetComparisonDDLStatements(typeof(dfDto2), "main.test2");