Class QueryContext<T>
Pairs a LINQ queryable expression tree with the partition key it was created for. Returned by GetQueryContextAsync(string) as the starting point for building custom queries in derived repository classes.
Inherited Members
Namespace: Benday.CosmosDb.Repositories
Assembly: Benday.CosmosDb.dll
Syntax
public class QueryContext<T> where T : class, ICosmosIdentity, new()
Type Parameters
| Name | Description |
|---|---|
| T | The entity type being queried. |
Constructors
| Edit this page View SourceQueryContext(PartitionKey, IOrderedQueryable<T>)
Creates a new query context.
Declaration
public QueryContext(PartitionKey partitionKey, IOrderedQueryable<T> queryable)
Parameters
| Type | Name | Description |
|---|---|---|
| PartitionKey | partitionKey | The partition key that scopes this query. |
| IOrderedQueryable<T> | queryable | The LINQ expression tree for building queries against Cosmos DB. |
Properties
| Edit this page View SourcePartitionKey
The partition key that scopes this query. Pass this to
GetResultsAsync so the query executes within the correct partition
and RU consumption is logged accurately.
Declaration
public PartitionKey PartitionKey { get; }
Property Value
| Type | Description |
|---|---|
| PartitionKey |
Queryable
The LINQ expression tree for building queries against Cosmos DB.
Chain .Where(), .OrderBy(), etc. to build your query,
then pass the result to GetResultsAsync for execution.
Declaration
public IOrderedQueryable<T> Queryable { get; }
Property Value
| Type | Description |
|---|---|
| IOrderedQueryable<T> |