Class QueryCompilationContext
- Namespace
- Microsoft.EntityFrameworkCore.Query
- Assembly
- Microsoft.EntityFrameworkCore.dll
The primary data structure representing the state/components used during query compilation.
This type is typically used by database providers (and other extensions). It is generally not used in application code.
public class QueryCompilationContext
- Inheritance
-
QueryCompilationContext
- Inherited Members
Remarks
See Implementation of database providers and extensions and How EF Core queries work for more information and examples.
Constructors
QueryCompilationContext(QueryCompilationContextDependencies, bool)
Creates a new instance of the QueryCompilationContext class.
public QueryCompilationContext(QueryCompilationContextDependencies dependencies, bool async)
Parameters
dependencies
QueryCompilationContextDependenciesParameter object containing dependencies for this class.
async
boolA bool value indicating whether it is for async query.
Fields
NotTranslatedExpression
Expression representing a not translated expression in query tree during translation phase.
This property is typically used by database providers (and other extensions). It is generally not used in application code.
public static readonly Expression NotTranslatedExpression
Field Value
QueryContextParameter
ParameterExpression representing QueryContext parameter in query expression.
This property is typically used by database providers (and other extensions). It is generally not used in application code.
public static readonly ParameterExpression QueryContextParameter
Field Value
QueryParameterPrefix
Prefix for all the query parameters generated during parameter extraction in query pipeline.
This property is typically used by database providers (and other extensions). It is generally not used in application code.
public const string QueryParameterPrefix = "__"
Field Value
Properties
ContextOptions
The ContextOptions to use during query compilation.
public virtual IDbContextOptions ContextOptions { get; }
Property Value
ContextType
The CLR type of derived DbContext to use during query compilation.
public virtual Type ContextType { get; }
Property Value
Dependencies
Dependencies for this service.
protected virtual QueryCompilationContextDependencies Dependencies { get; }
Property Value
IgnoreAutoIncludes
A value indicating whether eager loaded navigations are ignored in this query.
public virtual bool IgnoreAutoIncludes { get; }
Property Value
IgnoreQueryFilters
A value indicating whether query filters are ignored in this query.
public virtual bool IgnoreQueryFilters { get; }
Property Value
IsAsync
A value indicating whether it is async query.
public virtual bool IsAsync { get; }
Property Value
IsBuffering
A value indicating whether the underlying server query needs to pre-buffer all data.
public virtual bool IsBuffering { get; }
Property Value
Logger
The query logger to use during query compilation.
public virtual IDiagnosticsLogger<DbLoggerCategory.Query> Logger { get; }
Property Value
Model
The model to use during query compilation.
public virtual IModel Model { get; }
Property Value
QueryTrackingBehavior
A value indicating QueryTrackingBehavior of the query.
public virtual QueryTrackingBehavior QueryTrackingBehavior { get; }
Property Value
Tags
The set of tags applied to this query.
public virtual ISet<string> Tags { get; }
Property Value
Methods
AddTag(string)
Adds a tag to Tags.
public virtual void AddTag(string tag)
Parameters
tag
stringThe tag to add.
CreateQueryExecutor<TResult>(Expression)
Creates the query executor func which gives results for this query.
public virtual Func<QueryContext, TResult> CreateQueryExecutor<TResult>(Expression query)
Parameters
query
ExpressionThe query to generate executor for.
Returns
- Func<QueryContext, TResult>
Returns Func<T, TResult> which can be invoked to get results of this query.
Type Parameters
TResult
The result type of this query.
RegisterRuntimeParameter(string, LambdaExpression)
Registers a runtime parameter that is being added at some point during the compilation phase. A lambda must be provided, which will extract the parameter's value from the QueryContext every time the query is executed.
public virtual ParameterExpression RegisterRuntimeParameter(string name, LambdaExpression valueExtractor)
Parameters
name
stringvalueExtractor
LambdaExpression