DatabaseProvider<TOptionsExtension> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The primary point where a database provider can tell EF that it has been selected for the current context.
This type is typically used by database providers (and other extensions). It is generally not used in application code.
public class DatabaseProvider<TOptionsExtension> : Microsoft.EntityFrameworkCore.Storage.IDatabaseProvider where TOptionsExtension : class, IDbContextOptionsExtension
type DatabaseProvider<'OptionsExtension (requires 'OptionsExtension : null and 'OptionsExtension :> IDbContextOptionsExtension)> = class
interface IDatabaseProvider
Public Class DatabaseProvider(Of TOptionsExtension)
Implements IDatabaseProvider
Type Parameters
- TOptionsExtension
The type of options that the database provider will add to Extensions to identify that is has been selected (and to store its database specific settings).
- Inheritance
-
DatabaseProvider<TOptionsExtension>
- Implements
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.
Constructors
DatabaseProvider<TOptionsExtension>(DatabaseProviderDependencies) |
Initializes a new instance of the DatabaseProvider<TOptionsExtension> class. |
Properties
Dependencies |
Dependencies for this service. |
Name |
The unique name used to identify the database provider. This should be the same as the NuGet package name for the providers runtime. |
Version |
The value of the InformationalVersion for the database provider assembly. |
Methods
IsConfigured(IDbContextOptions) |
Gets a value indicating whether this database provider has been selected for a given context. |
Applies to
Entity Framework