C# 聚合操作-Linq中不支持类型“System.Data.Linq.Binary”
在上面的查询章节中,Logo的类型为byte[],当我尝试执行此查询时,我遇到以下错误 聚合操作-Linq中不支持类型“System.Data.Linq.Binary”C# 聚合操作-Linq中不支持类型“System.Data.Linq.Binary”,c#,linq,C#,Linq,在上面的查询章节中,Logo的类型为byte[],当我尝试执行此查询时,我遇到以下错误 聚合操作-Linq中不支持类型“System.Data.Linq.Binary” 当我执行上述查询时,出现以下错误:“System.Data.Linq.Binary”不包含“Count”的定义,并且找不到接受“System.Data.Linq.Binary”类型的第一个参数的扩展方法“Count”。您能告诉我此查询的作用吗。表示您对此查询的期望值?用户有章节列表,章节有出版物列表。我需要一份章节列表和出
当我执行上述查询时,出现以下错误:“System.Data.Linq.Binary”不包含“Count”的定义,并且找不到接受“System.Data.Linq.Binary”类型的第一个参数的扩展方法“Count”。您能告诉我此查询的作用吗。表示您对此查询的期望值?用户有章节列表,章节有出版物列表。我需要一份章节列表和出版数量。结果应该如下[{ID,ChapterName,PublicationCount,Logo},{ID,ChapterName,PublicationCount,Logo}]当我执行上述查询时,出现以下错误“System.Data.Linq.Binary”不包含“Count”的定义,并且没有扩展方法“Count”接受类型为“System.Data.Linq.Binary”的第一个参数,您能告诉我此查询的作用吗。表示您对此查询的期望值?用户有章节列表,章节有出版物列表。我需要一份章节列表和出版数量。结果应如下[{ID,ChapterName,PublicationCount,Logo},{ID,ChapterName,PublicationCount,Logo}]获取以下错误SQL Server不处理NText,Text,Xml的比较,或图像数据类型以下代码对我有效,但我不喜欢子查询从KM_章节中的章节获取章节徽标logo=,其中chapter.Id==x.Key.Id选择chapter.logo获取以下错误SQL Server不处理NText、Text、Xml、,或者图像数据类型下面的代码对我有用,但我不喜欢子查询从KM_章节中的章节获取章节徽标logo=,其中chapter.Id==x.Key.Id选择chapter.logo
(from chapter in Chapters
join userChapter in UserChapters on chapter.Id equals userChapter.ChapterId
join pub in Publications on chapter.Id equals pub.ChapterId into P
from publication in P.DefaultIfEmpty()
where userChapter.UserId == 9
group new
{
PubID = publication.Id,
Logo = chapter.Logo
} by new { chapter.Id, chapter.Name} into x
orderby x.Key.Name
select new
{
Id = x.Key.Id,
chapterName = x.Key.Name,
PublicationCount = x.Count(z => z.PubID > 0),
Logo = x.Max(z=>z.Logo)
}
)
(from chapter in Chapters
join userChapter in UserChapters on chapter.Id equals userChapter.ChapterId
join pub in Publications on chapter.Id equals pub.ChapterId into P
from publication in P.DefaultIfEmpty()
where userChapter.UserId == 9
group new
{
PubID = publication.Id,
Logo = chapter.Logo
} by new { chapter.Id, chapter.Name} into x
orderby x.Key.Name
select new
{
Id = x.Key.Id,
chapterName = x.Key.Name,
Logo = x.Max(z=>z.Logo.Count())
}
(from chapter in Chapters
join userChapter in UserChapters on chapter.Id equals userChapter.ChapterId
join pub in Publications on chapter.Id equals pub.ChapterId into P
from pub in P.DefaultIfEmpty()
where userChapter.UserId == 9
group pub by new { chapter.Id, chapter.Name,chapter.Logo,pub.Id} into x
orderby x.Key.Name
select new
{
Id = x.Key.Id,
chapterName = x.Key.Name,
Logo = x.Key.Logo,
PublicationCount=x.Count()
}