Table of Contents

Class RelationalDatabaseCreatorDependencies

Namespace
Microsoft.EntityFrameworkCore.Storage
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

Service dependencies parameter class for RelationalDatabaseCreator

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

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 'With...' methods. Do not call the constructor at any point in this process.

The service lifetime is Scoped. This means that each Microsoft.EntityFrameworkCore.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.

public sealed class RelationalDatabaseCreatorDependencies
Inheritance
RelationalDatabaseCreatorDependencies
Inherited Members

Constructors

RelationalDatabaseCreatorDependencies(IModel, IRelationalConnection, IMigrationsModelDiffer, IMigrationsSqlGenerator, IMigrationCommandExecutor, ISqlGenerationHelper, IExecutionStrategyFactory, ICurrentDbContext, IDiagnosticsLogger<Command>)

Creates the service dependencies parameter object for a RelationalDatabaseCreator.

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 'With...' methods. Do not call the constructor at any point in this process.

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.

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.

public RelationalDatabaseCreatorDependencies(IModel model, IRelationalConnection connection, IMigrationsModelDiffer modelDiffer, IMigrationsSqlGenerator migrationsSqlGenerator, IMigrationCommandExecutor migrationCommandExecutor, ISqlGenerationHelper sqlGenerationHelper, IExecutionStrategyFactory executionStrategyFactory, ICurrentDbContext currentContext, IDiagnosticsLogger<DbLoggerCategory.Database.Command> commandLogger)

Parameters

model IModel
connection IRelationalConnection
modelDiffer IMigrationsModelDiffer
migrationsSqlGenerator IMigrationsSqlGenerator
migrationCommandExecutor IMigrationCommandExecutor
sqlGenerationHelper ISqlGenerationHelper
executionStrategyFactory IExecutionStrategyFactory
currentContext ICurrentDbContext
commandLogger IDiagnosticsLogger<Command>

Properties

CommandLogger

The command logger.

public IDiagnosticsLogger<DbLoggerCategory.Database.Command> CommandLogger { get; }

Property Value

IDiagnosticsLogger<Command>

Connection

Gets the connection for the database.

public IRelationalConnection Connection { get; }

Property Value

IRelationalConnection

CurrentContext

Contains the Microsoft.EntityFrameworkCore.DbContext currently in use.

public ICurrentDbContext CurrentContext { get; }

Property Value

ICurrentDbContext

ExecutionStrategyFactory

Gets the Microsoft.EntityFrameworkCore.Storage.IExecutionStrategyFactory to be used.

public IExecutionStrategyFactory ExecutionStrategyFactory { get; }

Property Value

IExecutionStrategyFactory

MigrationCommandExecutor

Gets the IMigrationCommandExecutor to be used.

public IMigrationCommandExecutor MigrationCommandExecutor { get; }

Property Value

IMigrationCommandExecutor

MigrationsSqlGenerator

The Migrations SQL generator.

public IMigrationsSqlGenerator MigrationsSqlGenerator { get; }

Property Value

IMigrationsSqlGenerator

Model

Gets the model for the context this creator is being used with.

public IModel Model { get; }

Property Value

IModel

ModelDiffer

The model differ.

public IMigrationsModelDiffer ModelDiffer { get; }

Property Value

IMigrationsModelDiffer

SqlGenerationHelper

Gets the ISqlGenerationHelper to be used.

public ISqlGenerationHelper SqlGenerationHelper { get; }

Property Value

ISqlGenerationHelper

Methods

With(IDiagnosticsLogger<Command>)

Clones this dependency parameter object with one service replaced.

public RelationalDatabaseCreatorDependencies With(IDiagnosticsLogger<DbLoggerCategory.Database.Command> commandLogger)

Parameters

commandLogger IDiagnosticsLogger<Command>

A replacement for the current dependency of this type.

Returns

RelationalDatabaseCreatorDependencies

A new parameter object with the given service replaced.

With(ICurrentDbContext)

Clones this dependency parameter object with one service replaced.

public RelationalDatabaseCreatorDependencies With(ICurrentDbContext currentContext)

Parameters

currentContext ICurrentDbContext

A replacement for the current dependency of this type.

Returns

RelationalDatabaseCreatorDependencies

A new parameter object with the given service replaced.

With(IModel)

Clones this dependency parameter object with one service replaced.

public RelationalDatabaseCreatorDependencies With(IModel model)

Parameters

model IModel

A replacement for the current dependency of this type.

Returns

RelationalDatabaseCreatorDependencies

A new parameter object with the given service replaced.

With(IMigrationCommandExecutor)

Clones this dependency parameter object with one service replaced.

public RelationalDatabaseCreatorDependencies With(IMigrationCommandExecutor migrationCommandExecutor)

Parameters

migrationCommandExecutor IMigrationCommandExecutor

A replacement for the current dependency of this type.

Returns

RelationalDatabaseCreatorDependencies

A new parameter object with the given service replaced.

With(IMigrationsModelDiffer)

Clones this dependency parameter object with one service replaced.

public RelationalDatabaseCreatorDependencies With(IMigrationsModelDiffer modelDiffer)

Parameters

modelDiffer IMigrationsModelDiffer

A replacement for the current dependency of this type.

Returns

RelationalDatabaseCreatorDependencies

A new parameter object with the given service replaced.

With(IMigrationsSqlGenerator)

Clones this dependency parameter object with one service replaced.

public RelationalDatabaseCreatorDependencies With(IMigrationsSqlGenerator migrationsSqlGenerator)

Parameters

migrationsSqlGenerator IMigrationsSqlGenerator

A replacement for the current dependency of this type.

Returns

RelationalDatabaseCreatorDependencies

A new parameter object with the given service replaced.

With(IExecutionStrategyFactory)

Clones this dependency parameter object with one service replaced.

public RelationalDatabaseCreatorDependencies With(IExecutionStrategyFactory executionStrategyFactory)

Parameters

executionStrategyFactory IExecutionStrategyFactory

A replacement for the current dependency of this type.

Returns

RelationalDatabaseCreatorDependencies

A new parameter object with the given service replaced.

With(IRelationalConnection)

Clones this dependency parameter object with one service replaced.

public RelationalDatabaseCreatorDependencies With(IRelationalConnection connection)

Parameters

connection IRelationalConnection

A replacement for the current dependency of this type.

Returns

RelationalDatabaseCreatorDependencies

A new parameter object with the given service replaced.

With(ISqlGenerationHelper)

Clones this dependency parameter object with one service replaced.

public RelationalDatabaseCreatorDependencies With(ISqlGenerationHelper sqlGenerationHelper)

Parameters

sqlGenerationHelper ISqlGenerationHelper

A replacement for the current dependency of this type.

Returns

RelationalDatabaseCreatorDependencies

A new parameter object with the given service replaced.