【发布时间】:2017-04-17 20:37:12
【问题描述】:
我想对 sql 查询进行 linq 查询
我的 linq 查询是这样的
var query3 = from p in _productRepository.Table
join bs in query2 on p.Id equals bs.ProductId
orderby p.ProductTags.Count(y=>y.Id==locationId)>0
select p;
如何在sql查询中实现这个p.ProductTags.Count(y=>y.Id==locationId)>0。
【问题讨论】:
-
您可以使用管理工作室中的 sql profiler 工具捕获您的 qry。即使通过 linq qry,它也会显示与数据库引擎一起使用的完整 tsql 代码。
标签: sql sql-server linq tsql