mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 07:22:57 +08:00
Add user test case
This commit is contained in:
parent
f5daf86eeb
commit
9889a648cb
@ -39,7 +39,20 @@ namespace OrmTest
|
|||||||
Db.DeleteNav<School>(s => s.Id.Equals(1))
|
Db.DeleteNav<School>(s => s.Id.Equals(1))
|
||||||
.Include(s => s.Grades).ExecuteCommandAsync().GetAwaiter().GetResult();
|
.Include(s => s.Grades).ExecuteCommandAsync().GetAwaiter().GetResult();
|
||||||
//Console.ReadLine();
|
//Console.ReadLine();
|
||||||
|
NewUnitTest.Db.Queryable<School>()
|
||||||
|
.Includes(x => x.Grades)
|
||||||
|
.Select(x => new
|
||||||
|
{
|
||||||
|
name = x.Grades.a==null?1: x.Grades.a.Value
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
NewUnitTest.Db.Queryable<School>()
|
||||||
|
.IncludeLeftJoin(x => x.Grades)
|
||||||
|
.Select(x => new
|
||||||
|
{
|
||||||
|
name = x.Grades.a == null ? 1 : x.Grades.a.Value
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,5 +73,8 @@ namespace OrmTest
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public string? Name { get; set; }
|
public string? Name { get; set; }
|
||||||
public int SchoolId { get; set; }
|
public int SchoolId { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public decimal? a { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user