SubQuery .Sum(it=>(int)it.XX) BUG

This commit is contained in:
610262374@qq.com
2018-11-23 14:08:54 +08:00
parent e68fa1a336
commit f6d3241d1d
4 changed files with 39 additions and 3 deletions

View File

@@ -94,6 +94,27 @@ namespace OrmTest.Demo
Id = SqlFunc.Subqueryable<School>().Where(s => s.Id == it.Id).Select(s => s.Id)
}).ToList();
var getAll6 = db.Queryable<Student>().Select(it =>
new
{
name = it.Name,
id = SqlFunc.Subqueryable<Student>().Where(s => s.Id == it.Id).Sum(s => (int)s.SchoolId)
}).ToList();
var getAll66 = db.Queryable<Student>().Select(it =>
new
{
name = it.Name,
id = SqlFunc.Subqueryable<Student>().Where(s => s.Id == it.Id).Sum(s =>s.SchoolId.Value)
}).ToList();
var getAll666 = db.Queryable<Student>().Select(it =>
new
{
name = it.Name,
id = SqlFunc.Subqueryable<Student>().Where(s => s.Id == it.Id).Min(s => s.Id)
}).ToList();
}
private static void Async()