次のような別のオブジェクトのリストを含むオブジェクトがあります。
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