共用方式為


RelationalDbContextOptionsBuilder<TBuilder,TExtension> Class

Definition

Allows relational database specific configuration to be performed on DbContextOptions.

public abstract class RelationalDbContextOptionsBuilder<TBuilder,TExtension> where TBuilder : RelationalDbContextOptionsBuilder<TBuilder,TExtension> where TExtension : RelationalOptionsExtension
public abstract class RelationalDbContextOptionsBuilder<TBuilder,TExtension> where TBuilder : RelationalDbContextOptionsBuilder<TBuilder,TExtension> where TExtension : RelationalOptionsExtension, new()
public abstract class RelationalDbContextOptionsBuilder<TBuilder,TExtension> : Microsoft.EntityFrameworkCore.Infrastructure.IRelationalDbContextOptionsBuilderInfrastructure where TBuilder : RelationalDbContextOptionsBuilder<TBuilder,TExtension> where TExtension : RelationalOptionsExtension, new()
type RelationalDbContextOptionsBuilder<'Builder, 'Extension (requires 'Builder :> RelationalDbContextOptionsBuilder<'Builder, 'Extension> and 'Extension :> RelationalOptionsExtension)> = class
type RelationalDbContextOptionsBuilder<'Builder, 'Extension (requires 'Builder :> RelationalDbContextOptionsBuilder<'Builder, 'Extension> and 'Extension :> RelationalOptionsExtension and 'Extension : (new : unit -> 'Extension))> = class
type RelationalDbContextOptionsBuilder<'Builder, 'Extension (requires 'Builder :> RelationalDbContextOptionsBuilder<'Builder, 'Extension> and 'Extension :> RelationalOptionsExtension and 'Extension : (new : unit -> 'Extension))> = class
    interface IRelationalDbContextOptionsBuilderInfrastructure
Public MustInherit Class RelationalDbContextOptionsBuilder(Of TBuilder, TExtension)
Public MustInherit Class RelationalDbContextOptionsBuilder(Of TBuilder, TExtension)
Implements IRelationalDbContextOptionsBuilderInfrastructure

Type Parameters

TBuilder
TExtension
Inheritance
RelationalDbContextOptionsBuilder<TBuilder,TExtension>
Derived
Implements

Remarks

Instances of this class are typically returned from methods that configure the context to use a particular relational database provider.

See Using DbContextOptions for more information and examples.

Constructors

RelationalDbContextOptionsBuilder<TBuilder,TExtension>(DbContextOptionsBuilder)

Initializes a new instance of the RelationalDbContextOptionsBuilder<TBuilder,TExtension> class.

Properties

OptionsBuilder

Gets the core options builder.

Methods

CloneExtension()

Clones the configuration in this builder.

CommandTimeout(Nullable<Int32>)

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

ExecutionStrategy(Func<ExecutionStrategyContext,IExecutionStrategy>)

Configures the context to use the provided IExecutionStrategy.

ExecutionStrategy(Func<ExecutionStrategyDependencies,IExecutionStrategy>)

Configures the context to use the provided IExecutionStrategy.

MaxBatchSize(Int32)

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

MigrationsAssembly(Assembly)

Configures the assembly where migrations are maintained for this context.

MigrationsAssembly(String)

Configures the assembly where migrations are maintained for this context.

MigrationsHistoryTable(String, String)

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

MinBatchSize(Int32)

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

SetOption(Action<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.

TranslateParameterizedCollectionsToConstants()

Configures the context to translate parameterized collections to inline constants.

TranslateParameterizedCollectionsToParameters()

Configures the context to translate parameterized collections to parameters.

UseQuerySplittingBehavior(QuerySplittingBehavior)

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

UseRelationalNulls()

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.

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.

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.

Explicit Interface Implementations

IRelationalDbContextOptionsBuilderInfrastructure.OptionsBuilder

Gets the core options builder.

Applies to