単純な質問かもしれませAsQueryable()
んが、パフォーマンスが低下することはありますか?
一般的に言えば、RavenDB を使用しており、このような既存のコードがあります。
protected override IQueryable<T> QueryableIndexRawQuery(string rawQuery, int skip = 0, int take = 128, string indexName = null)
{
var defaultIndexName = !string.IsNullOrWhiteSpace(indexName) ? indexName : string.Format("{0}{1}", typeof(T).Name, IndexPreffix);
return this.Session.Advanced.DocumentStore.DatabaseCommands.GetIndex(defaultIndexName) != null
? this.Session.Advanced.LuceneQuery<T>(defaultIndexName).Statistics(out this.Statistics).Skip(skip).Take(take).Where(rawQuery).AsQueryable()
: this.Session.Advanced.LuceneQuery<T>().Statistics(out this.Statistics).Skip(skip).Take(take).Where(rawQuery).AsQueryable();
}
Where句が私たちを返すのでIDocumentQuery
、それを表現しようとしますAsQueryable()
this.Session.Advanced.LuceneQuery<T>(defaultIndexName).Statistics(out this.Statistics).Skip(skip).Take(take).Where(rawQuery)
AsQueryable()
最終的に内部で何をするのかという質問は?どのように変換しますか?のようなメモリ内コレクションの例を含む回答List<>
も非常に役立ちます。
このような:
var list = new List<string>() { "1", "2", "3" };
list.AsQueryable();