Table of Contents

Class CloudStorageQueryProvider

Namespace
CloudStorageORM.Infrastructure
Assembly
CloudStorageORM.dll

Query provider that executes LINQ expressions against object-storage-backed entities.

public class CloudStorageQueryProvider : IAsyncQueryProvider, IQueryProvider
Inheritance
CloudStorageQueryProvider
Implements
Inherited Members

Constructors

CloudStorageQueryProvider(CloudStorageDatabase, IBlobPathResolver, ILogger<CloudStorageQueryProvider>?, bool, bool)

Query provider that executes LINQ expressions against object-storage-backed entities.

public CloudStorageQueryProvider(CloudStorageDatabase database, IBlobPathResolver blobPathResolver, ILogger<CloudStorageQueryProvider>? logger = null, bool enableLogging = true, bool enableTracing = true)

Parameters

database CloudStorageDatabase
blobPathResolver IBlobPathResolver
logger ILogger<CloudStorageQueryProvider>
enableLogging bool
enableTracing bool

Methods

CreateQuery(Expression)

Constructs an IQueryable object that can evaluate the query represented by a specified expression tree.

public IQueryable CreateQuery(Expression expression)

Parameters

expression Expression

An expression tree that represents a LINQ query.

Returns

IQueryable

An IQueryable that can evaluate the query represented by the specified expression tree.

CreateQuery<TElement>(Expression)

Constructs an IQueryable<T> object that can evaluate the query represented by a specified expression tree.

public IQueryable<TElement> CreateQuery<TElement>(Expression expression)

Parameters

expression Expression

An expression tree that represents a LINQ query.

Returns

IQueryable<TElement>

An IQueryable<T> that can evaluate the query represented by the specified expression tree.

Type Parameters

TElement

The type of the elements of the IQueryable<T> that is returned.

Execute(Expression)

Executes the query represented by a specified expression tree.

public object Execute(Expression expression)

Parameters

expression Expression

An expression tree that represents a LINQ query.

Returns

object

The value that results from executing the specified query.

ExecuteAsync<TResult>(Expression, CancellationToken)

Executes a LINQ expression asynchronously and returns the materialized result.

public Task<TResult> ExecuteAsync<TResult>(Expression expression, CancellationToken cancellationToken = default)

Parameters

expression Expression

Expression tree to execute.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TResult>

The query result.

Type Parameters

TResult

Expected query result type.

Examples

var result = await provider.ExecuteAsync<IEnumerable<User>>(query.Expression);

Execute<TResult>(Expression)

Executes the strongly-typed query represented by a specified expression tree.

public TResult Execute<TResult>(Expression expression)

Parameters

expression Expression

An expression tree that represents a LINQ query.

Returns

TResult

The value that results from executing the specified query.

Type Parameters

TResult

The type of the value that results from executing the query.