0
var query = (from article in ArticleRepository.GetAll()
join read in ArticleReadRepository.GetAll() on read.ArticleId equals article.Id
where article.Id>10
select new
{
article.Title,
read.ReadCount
}).ToList();
LINQ表达式翻译成SQL字符串
select article.Title,
read.ReadCount
from ArticleTable as article
join ArticleReadTable as read on read.ArticleId = article.Id
where article.Id>10
使用C#代码
实际上,我想知道query.ToString()的实现......好吧,我会看到它的源代码。 –
您可以从'query.ToString'中将其作为字符串进行检索并将其作为sql查询进行触发。 –
@ReimuLyu如果它解决了您的问题,请将其标记为答案 –