Share via


SqlEngineDbContextOptionsBuilder Class

Definition

Allows SQL Server, Azure SQL, Azure Synapse specific configuration to be performed on DbContextOptions.

[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1 })]
public class SqlEngineDbContextOptionsBuilder : Microsoft.EntityFrameworkCore.Infrastructure.SqlEngineDbContextOptionsBuilderBase<Microsoft.EntityFrameworkCore.Infrastructure.SqlEngineDbContextOptionsBuilder>
[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1, 1 })]
public class SqlEngineDbContextOptionsBuilder : Microsoft.EntityFrameworkCore.Infrastructure.RelationalDbContextOptionsBuilder<Microsoft.EntityFrameworkCore.Infrastructure.SqlEngineDbContextOptionsBuilder,Microsoft.EntityFrameworkCore.SqlServer.Infrastructure.Internal.SqlServerOptionsExtension>
[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1 })>]
type SqlEngineDbContextOptionsBuilder = class
    inherit SqlEngineDbContextOptionsBuilderBase<SqlEngineDbContextOptionsBuilder>
[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1, 1 })>]
type SqlEngineDbContextOptionsBuilder = class
    inherit RelationalDbContextOptionsBuilder<SqlEngineDbContextOptionsBuilder, SqlServerOptionsExtension>
Public Class SqlEngineDbContextOptionsBuilder
Inherits SqlEngineDbContextOptionsBuilderBase(Of SqlEngineDbContextOptionsBuilder)
Public Class SqlEngineDbContextOptionsBuilder
Inherits RelationalDbContextOptionsBuilder(Of SqlEngineDbContextOptionsBuilder, SqlServerOptionsExtension)
Inheritance
Inheritance
RelationalDbContextOptionsBuilder<SqlEngineDbContextOptionsBuilder,Microsoft.EntityFrameworkCore.SqlServer.Infrastructure.Internal.SqlServerOptionsExtension>
SqlEngineDbContextOptionsBuilder
Attributes

Remarks

Instances of this class are returned from a call to SqlServerDbContextOptionsExtensions.ConfigureSqlEngine and it is not designed to be directly constructed in your application code.

Constructors

Name Description
SqlEngineDbContextOptionsBuilder(DbContextOptionsBuilder)

Initializes a new instance of the SqlServerDbContextOptionsBuilder class.

Properties

Name Description
OptionsBuilder

Gets the core options builder.

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)

Methods

Name Description
CommandTimeout(Nullable<Int32>)

Configures the wait time (in seconds) before terminating the attempt to execute a command and generating an error.

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)
EnableRetryOnFailure()

Configures the context to use the default retrying IExecutionStrategy.

EnableRetryOnFailure(ICollection<Int32>)

Configures the context to use the default retrying IExecutionStrategy.

EnableRetryOnFailure(Int32, TimeSpan, IEnumerable<Int32>)

Configures the context to use the default retrying IExecutionStrategy.

EnableRetryOnFailure(Int32)

Configures the context to use the default retrying IExecutionStrategy.

EnableRetryOnFailureByDefault()

Configures the context to use the default retrying IExecutionStrategy unless it is configured explicitly.

ExecutionStrategy(Func<ExecutionStrategyDependencies,IExecutionStrategy>)

Configures the context to use the provided IExecutionStrategy.

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)
MaxBatchSize(Int32)

Configures the maximum number of statements that will be included in commands sent to the database during SaveChanges().

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)
MigrationsAssembly(Assembly)

Configures the assembly where migrations are maintained for this context.

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)
MigrationsAssembly(String)

Configures the assembly where migrations are maintained for this context.

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)
MigrationsHistoryTable(String, String)

Configures the name of the table used to record which migrations have been applied to the database.

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)
MinBatchSize(Int32)

Configures the minimum number of statements that are needed for a multi-statement command sent to the database during SaveChanges().

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)
TranslateParameterizedCollectionsToConstants()
Obsolete.

Configures the context to translate parameterized collections to inline constants.

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)
TranslateParameterizedCollectionsToParameters()
Obsolete.

Configures the context to translate parameterized collections to a single array-like parameter.

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)
UseQuerySplittingBehavior(QuerySplittingBehavior)

Configures the QuerySplittingBehavior to use when loading related collections in a query.

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)
UseRelationalNulls(Boolean)

Configures the context to use relational database semantics when comparing null values. By default, Entity Framework will use C# semantics for null values, and generate SQL to compensate for differences in how the database handles nulls.

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)
WithOption(Func<TExtension,TExtension>)

Sets an option by cloning the extension used to store the settings. This ensures the builder does not modify options that are already in use elsewhere.

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)

Explicit Interface Implementations

Name Description
IRelationalDbContextOptionsBuilderInfrastructure.OptionsBuilder

Gets the core options builder.

(Inherited from RelationalDbContextOptionsBuilder<TBuilder,TExtension>)

Applies to