mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-26 10:49:20 +08:00
SubQuery support join
This commit is contained in:
@@ -122,7 +122,11 @@ namespace OrmTest
|
||||
customName2 = SqlFunc.Subqueryable<Custom>().Where("it.CustomId = id").Where(s => true).Select(s => s.Name)
|
||||
}).ToList();
|
||||
|
||||
var list2 = db.Queryable<Order>().Where(it => SqlFunc.Subqueryable<OrderItem>().Where(i => i.OrderId == it.Id).Any()).ToList();
|
||||
var list2 = db.Queryable<Order>().Where(it =>
|
||||
SqlFunc.Subqueryable<OrderItem>()
|
||||
.LeftJoin<OrderItem>((i,y)=>i.ItemId==y.ItemId)
|
||||
.Where<OrderItem>((i,y) => y.ItemId== it.Id).Any()
|
||||
).ToList();
|
||||
|
||||
Console.WriteLine("#### Subquery End ####");
|
||||
}
|
||||
|
||||
@@ -196,6 +196,9 @@
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="UnitTest\models\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
Reference in New Issue
Block a user