Table of Contents

Interface IDatabaseProvider

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

The primary point where a database provider can tell EF that it has been selected for the current context and provide the services required for it to function.

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

public interface IDatabaseProvider

Remarks

The service lifetime is Singleton. This means a single instance is used by many DbContext instances. The implementation must be thread-safe. This service cannot depend on services registered as Scoped.

See Implementation of database providers and extensions for more information and examples.

Properties

Name

The unique name used to identify the database provider. This should be the same as the NuGet package name for the providers runtime.

string Name { get; }

Property Value

string

Version

The value of the InformationalVersion for the database provider assembly.

string? Version { get; }

Property Value

string

Methods

IsConfigured(IDbContextOptions)

Gets a value indicating whether this database provider has been configured for a given context.

bool IsConfigured(IDbContextOptions options)

Parameters

options IDbContextOptions

The options for the context.

Returns

bool

true if the database provider has been configured, otherwise false.