mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 优化 MapRead 对 NULL 字段的处理;
This commit is contained in:
@ -10,6 +10,41 @@ namespace FreeSql.Tests
|
||||
{
|
||||
public class UnitTest4
|
||||
{
|
||||
[Fact]
|
||||
public void LeftJoinNull01()
|
||||
{
|
||||
var fsql = g.sqlite;
|
||||
fsql.Delete<leftjoin_null01>().Where("1=1").ExecuteAffrows();
|
||||
fsql.Delete<leftjoin_null02>().Where("1=1").ExecuteAffrows();
|
||||
|
||||
var item = new leftjoin_null01 { name = "xx01" };
|
||||
fsql.Insert(item).ExecuteAffrows();
|
||||
|
||||
var sel1 = fsql.Select<leftjoin_null01, leftjoin_null02>()
|
||||
.LeftJoin((a, b) => a.id == b.null01_id)
|
||||
.First((a, b) => new
|
||||
{
|
||||
a.id,
|
||||
a.name,
|
||||
id2 = (Guid?)b.id,
|
||||
time2 = (DateTime?)b.time
|
||||
});
|
||||
Assert.Null(sel1.id2);
|
||||
Assert.Null(sel1.time2);
|
||||
}
|
||||
|
||||
class leftjoin_null01
|
||||
{
|
||||
public Guid id { get; set; }
|
||||
public string name { get; set; }
|
||||
}
|
||||
class leftjoin_null02
|
||||
{
|
||||
public Guid id { get; set; }
|
||||
public Guid null01_id { get; set; }
|
||||
public DateTime time { get; set; }
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void TestHzyTuple()
|
||||
|
Reference in New Issue
Block a user