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
databaseCloudStorageDatabaseblobPathResolverIBlobPathResolverloggerILogger<CloudStorageQueryProvider>enableLoggingboolenableTracingbool
Methods
CreateQuery(Expression)
Constructs an IQueryable object that can evaluate the query represented by a specified expression tree.
public IQueryable CreateQuery(Expression expression)
Parameters
expressionExpressionAn 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
expressionExpressionAn 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
TElementThe 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
expressionExpressionAn 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
expressionExpressionExpression tree to execute.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<TResult>
The query result.
Type Parameters
TResultExpected 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
expressionExpressionAn expression tree that represents a LINQ query.
Returns
- TResult
The value that results from executing the specified query.
Type Parameters
TResultThe type of the value that results from executing the query.