Show / Hide Table of Contents

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.

Inheritance
object
QueryContext<T>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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 Source

QueryContext(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 Source

PartitionKey

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
| Edit this page View Source

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>
  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com