Table of Contents

Class QueryCompilationContextDependencies

Namespace
Microsoft.EntityFrameworkCore.Query
Assembly
Microsoft.EntityFrameworkCore.dll

Service dependencies parameter class for QueryCompilationContext

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public sealed record QueryCompilationContextDependencies : IEquatable<QueryCompilationContextDependencies>
Inheritance
QueryCompilationContextDependencies
Implements
Inherited Members

Remarks

Do not construct instances of this class directly from either provider or application code as the constructor signature may change as new dependencies are added. Instead, use this type in your constructor so that an instance will be created and injected automatically by the dependency injection container. To create an instance with some dependent services replaced, first resolve the object from the dependency injection container, then replace selected services using the C# 'with' operator. Do not call the constructor at any point in this process.

The service lifetime is Scoped. This means that each DbContext instance will use its own instance of this service. The implementation may depend on other services registered with any lifetime. The implementation does not need to be thread-safe.

Constructors

QueryCompilationContextDependencies(IModel, IQueryTranslationPreprocessorFactory, IQueryableMethodTranslatingExpressionVisitorFactory, IQueryTranslationPostprocessorFactory, IShapedQueryCompilingExpressionVisitorFactory, IExecutionStrategy, ICurrentDbContext, IDbContextOptions, IDiagnosticsLogger<Query>, IInterceptors)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

[EntityFrameworkInternal]
public QueryCompilationContextDependencies(IModel model, IQueryTranslationPreprocessorFactory queryTranslationPreprocessorFactory, IQueryableMethodTranslatingExpressionVisitorFactory queryableMethodTranslatingExpressionVisitorFactory, IQueryTranslationPostprocessorFactory queryTranslationPostprocessorFactory, IShapedQueryCompilingExpressionVisitorFactory shapedQueryCompilingExpressionVisitorFactory, IExecutionStrategy executionStrategy, ICurrentDbContext currentContext, IDbContextOptions contextOptions, IDiagnosticsLogger<DbLoggerCategory.Query> logger, IInterceptors interceptors)

Parameters

model IModel
queryTranslationPreprocessorFactory IQueryTranslationPreprocessorFactory
queryableMethodTranslatingExpressionVisitorFactory IQueryableMethodTranslatingExpressionVisitorFactory
queryTranslationPostprocessorFactory IQueryTranslationPostprocessorFactory
shapedQueryCompilingExpressionVisitorFactory IShapedQueryCompilingExpressionVisitorFactory
executionStrategy IExecutionStrategy
currentContext ICurrentDbContext
contextOptions IDbContextOptions
logger IDiagnosticsLogger<DbLoggerCategory.Query>
interceptors IInterceptors

Remarks

Do not call this constructor directly from either provider or application code as it may change as new dependencies are added. Instead, use this type in your constructor so that an instance will be created and injected automatically by the dependency injection container. To create an instance with some dependent services replaced, first resolve the object from the dependency injection container, then replace selected services using the C# 'with' operator. Do not call the constructor at any point in this process.

Properties

Context

The current context.

public DbContext Context { get; }

Property Value

DbContext

ContextOptions

The context options.

public IDbContextOptions ContextOptions { get; init; }

Property Value

IDbContextOptions

ContextType

The CLR type of DbContext.

public Type ContextType { get; }

Property Value

Type

Interceptors

Registered interceptors.

public IInterceptors Interceptors { get; }

Property Value

IInterceptors

IsRetryingExecutionStrategy

Whether the configured execution strategy can retry.

public bool IsRetryingExecutionStrategy { get; init; }

Property Value

bool

Logger

The logger.

public IDiagnosticsLogger<DbLoggerCategory.Query> Logger { get; init; }

Property Value

IDiagnosticsLogger<DbLoggerCategory.Query>

Model

The model.

public IModel Model { get; init; }

Property Value

IModel

QueryTrackingBehavior

The default query tracking behavior.

public QueryTrackingBehavior QueryTrackingBehavior { get; }

Property Value

QueryTrackingBehavior

QueryTranslationPostprocessorFactory

The shaped-query optimizer factory

public IQueryTranslationPostprocessorFactory QueryTranslationPostprocessorFactory { get; init; }

Property Value

IQueryTranslationPostprocessorFactory

QueryTranslationPreprocessorFactory

The query optimizer factory.

public IQueryTranslationPreprocessorFactory QueryTranslationPreprocessorFactory { get; init; }

Property Value

IQueryTranslationPreprocessorFactory

QueryableMethodTranslatingExpressionVisitorFactory

The queryable method-translating expression visitor factory.

public IQueryableMethodTranslatingExpressionVisitorFactory QueryableMethodTranslatingExpressionVisitorFactory { get; init; }

Property Value

IQueryableMethodTranslatingExpressionVisitorFactory

ShapedQueryCompilingExpressionVisitorFactory

The shaped-query compiling expression visitor factory.

public IShapedQueryCompilingExpressionVisitorFactory ShapedQueryCompilingExpressionVisitorFactory { get; init; }

Property Value

IShapedQueryCompilingExpressionVisitorFactory

Methods

Equals(QueryCompilationContextDependencies?)

public bool Equals(QueryCompilationContextDependencies? other)

Parameters

other QueryCompilationContextDependencies

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

<Clone>$()

public QueryCompilationContextDependencies <Clone>$()

Returns

QueryCompilationContextDependencies

Operators

operator ==(QueryCompilationContextDependencies?, QueryCompilationContextDependencies?)

public static bool operator ==(QueryCompilationContextDependencies? left, QueryCompilationContextDependencies? right)

Parameters

left QueryCompilationContextDependencies
right QueryCompilationContextDependencies

Returns

bool

operator !=(QueryCompilationContextDependencies?, QueryCompilationContextDependencies?)

public static bool operator !=(QueryCompilationContextDependencies? left, QueryCompilationContextDependencies? right)

Parameters

left QueryCompilationContextDependencies
right QueryCompilationContextDependencies

Returns

bool