Update exp to sql

This commit is contained in:
sunkaixuna
2021-09-10 17:59:47 +08:00
parent b449a446f8
commit 0046f6c3c9
4 changed files with 23 additions and 2 deletions

View File

@@ -249,6 +249,13 @@ namespace OrmTest
customName = SqlFunc.Subqueryable<Custom>().Where(s=>s.Id==it.CustomId).GroupBy(s=>s.Name).Having(s=>SqlFunc.AggregateCount(s.Id)>0).Select(s => s.Name)
}).ToList();
var exp = Expressionable.Create<Custom>().And(s => s.Id==1).ToExpression();
var list4 = db.Queryable<Order>().Select(it => new
{
customName = SqlFunc.Subqueryable<Custom>().Where(exp).GroupBy(s => s.Name).Having(s => SqlFunc.AggregateCount(s.Id) > 0).Select(s => s.Name)
}).ToList();
Console.WriteLine("#### Subquery End ####");
}