我有一个对象,其中包含另一个对象的列表,如下所示:
class cl
{
List<a> a ;
public List<a> listofA
{
get; set;
}
}
class a
{
//other properties
string comment ;
public string comment
{
get; set;
}
}
现在我如何进行 linq 查询以查看评论是否属于某个字符串,这是我的查询:
var query = (from c in scope.Extent<cl>()
where c.Date >= dateFrom && c.Date < dateTo
&& c.Actions.Where(a => (a.comment== "") )
orderby c.Date.Value.Date
group c by c.Date.Value.Date into grpDate
select new { grpDate.Key, items = grpDate });
但我收到错误消息:
Error 15 Operator '&&' cannot be applied to operands of type 'bool' and 'System.Collections.Generic.IEnumerable<>
Error 13 Cannot convert lambda expression to type 'string' because it is not a delegate type