Nucleus .Net Core CMS

DataProvider Class

Namespace: Nucleus.Data.EntityFramework
Assembly: Nucleus.Data.EntityFramework.dll
Base class used by entity-framework data providers.

Remarks

Nucleus core and module data provider which use entity framework classes inherit this class, which contains an implementation of the schema migration functions. Data provider implementations which register a related DataProviderMigration class must inherit this class.

Constructor

Nucleus.Data.EntityFramework.DataProvider Constructor

Nucleus.Data.EntityFramework.DataProvider (DbContext context, ILogger<DataProvider> logger)
Constructor.
Parameters
Name Type
context Nucleus.Data.EntityFramework.DbContext
logger Microsoft.Extensions.Logging.ILogger<Nucleus.Data.EntityFramework.DataProvider>

Properties

Context Property

Entity framework DbContext.

Logger Property

Logger used to log messages.

Methods

CheckConnection

CheckConnection ()
Attempts a connection to the database. Throws a database provider specific exception if not successful.

GetDatabaseKey

GetDatabaseKey ()
Get the key for the database which corresponds to a section in the database configuration settings file.