CosmosLinqExtensions.ToQueryDefinition<T>(IQueryable<T>) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
This method generate query definition from LINQ query.
public static Microsoft.Azure.Cosmos.QueryDefinition ToQueryDefinition<T> (this System.Linq.IQueryable<T> query);
static member ToQueryDefinition : System.Linq.IQueryable<'T> -> Microsoft.Azure.Cosmos.QueryDefinition
<Extension()>
Public Function ToQueryDefinition(Of T) (query As IQueryable(Of T)) As QueryDefinition
Type Parameters
- T
the type of object to query.
Parameters
- query
- IQueryable<T>
the IQueryable{T} to be converted.
Returns
The queryDefinition which can be used in query execution.
Examples
This example shows how to generate query definition from LINQ.
IQueryable<T> queryable = container.GetItemsQueryIterator<T>(allowSynchronousQueryExecution = true)
.Where(t => b.id.contains("test"));
QueryDefinition queryDefinition = queryable.ToQueryDefinition();
Applies to
Spolupracujte s námi na GitHubu
Zdroj tohoto obsahu najdete na GitHubu, kde můžete také vytvářet a kontrolovat problémy a žádosti o přijetí změn. Další informace najdete v našem průvodci pro přispěvatele.
Azure SDK for .NET