【发布时间】:2010-10-10 23:07:44
【问题描述】:
更新 - 我修复了下面的查询。我有错误的查询/错误语句:(
我有如下声明:
var posts = BlogPostRepository.Find()
.Where(x => x.Tags.Where(y => y.Name == tag))
.ToList();
第二个(内部)Where 子句给我一个编译时错误,说:-
错误 1 无法将 lambda 表达式转换为委托类型“System.Func”,因为块中的某些返回类型不能隐式转换为委托返回类型
我正在尝试按特定标签名称过滤所有博客帖子。
【问题讨论】:
-
您的示例代码中的“tag”标识符是什么?
-
@CesarGon 具有
int Id和string Name的类。