class Foo{
public string FooText { get; set; }
public DateTime DateCreated { get; set; }
public DateTime DateModified { get; set; }
public ICollection<Bar> Bars{ get; set; }
}
class Bar{
public Foo Foo { get; set; }
public Language Language { get; set; }
public string FooText { get; set; }
public DateTime DateCreated { get; set; }
public DateTime DateModified { get; set; }
}
我有一个 Foo 的集合。我想使用语言名称为“English”的语言获取 Foo 和 Bar
fooCollection.Where(x =>
x.Translations.Where(q =>
q.Language.LanguageName == "English"));
这失败了。Can not convert Foo to bool.
我怎样才能做到这一点。本质上,我想获得语言为英语的 Foo 和 Bar。