mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Add unit test
This commit is contained in:
parent
d880808dd8
commit
e052a24695
@ -54,6 +54,17 @@ namespace OrmTest
|
||||
{
|
||||
dob=(IT.dob??0).ToString("0.0")
|
||||
}).ToList();
|
||||
|
||||
var sql = db.Queryable<Order>()
|
||||
.Select(it => new {
|
||||
//num=SqlFunc.Subqueryable<OrderItem>().Where(s=>s.OrderId==it.Id).Sum(s=>s.Price)??0,
|
||||
//num2 =SqlFunc.IsNull( SqlFunc.Subqueryable<OrderItem>().Where(s => s.OrderId == it.Id).Sum(s => s.Price),0) ,
|
||||
num3 = SqlFunc.Subqueryable<OrderItem>().Where(s => s.OrderId == it.Id).Sum(s => s.Price) + it.Id
|
||||
}).ToSqlString();
|
||||
if (sql != "SELECT ((SELECT SUM([Price]) FROM [OrderDetail] [s] WHERE ( [OrderId] = [it].[Id] )) + [it].[Id] ) AS [num3] FROM [Order] [it] ")
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user