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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Azure SDK for .NET