17

ドキュメントとして保存されている次のオブジェクト構造を考えてみましょう。

public class Foo
{
    public string Id { get; set; }
    public ICollection<FooBar> Bars { get; set; }

    // ...
}

public class FooBar
{
    public string BarId { get; set; }

    // ...
}

ドライバーで LINQ スタイルのクエリを使用すると、次のようなものをFindすべてFoo含めることができます。FooBar BarId

var foos = await m_fooCollection.Find( f => f.Bars.Any( fb => fb.BarId == "123") ).ToListAsync();

FilterDefinitionBuilderインライン LINQ onの代わりに を使用して、この同じクエリを実現するにはどうすればよいFindですか?

4

1 に答える 1