Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のようなものを入手することは可能ですか?
return Session.Query<A>().Where(x => x is B).ToList();
ここで、Bはインターフェイスで機能するAから派生します(つまり、特定のインターフェイスを実装するすべてのオブジェクトを取得します)?ありがとう。
このステートメントをSQLに直接変換することはできません。まず、クエリを評価するか、を使用する必要がありますAsEnumerable()。
AsEnumerable()
return Session.Query<A>().AsEnumerable().Where(x => x is B).ToList();
または:
return Session.Query<A>().AsEnumerable().OfType<B>().ToList();
後の部分AsEnumerableはメモリ内で実行されます。
AsEnumerable