如何执行 aselect count(*) from UnrelatedTable where documentLink_Id = x.documentLink_id并将结果计数添加到totalTimeAccessed. 两个表(PublishedContent和UnrelatedTable有documentLink_id)的共同点。然后我只想选择计数大于 0 的行
var dbData = publishedontext.PublishedContent
.Where(x => x.Status > PublishedStatus.Released)
.OrderBy(x => x.Title)
.Select(x => new DownloadsPerContetnItemReportRows()
{
title = x.Title,
documentLink_Id = x.DocumentLink_Id,
statustatus = x.Status,
totalTimeAccessed = "Select count from an unrelated table"
}
幕布斯6054654
相关分类