Nucleus .Net Core CMS

DataProviderFactory Class

Namespace: Nucleus.Data.Common
Assembly: Nucleus.Data.Common.dll
Data provider factory base class. Provides common functionality for data providers.

Constructor

Nucleus.Data.Common.DataProviderFactory Constructor

Nucleus.Data.Common.DataProviderFactory (System.IServiceProvider,  Microsoft.Extensions.Logging.ILogger{Nucleus.Data.Common.DataProviderFactory})
Constructor (called by DI)

Methods

PreventSchemaCheck (String) Method

PreventSchemaCheck (String schemaName)
Prevent database schema checking.
Parameters
Name Type
schemaName String
Remarks
Extensions can use this method to suppress the default Nucleus behaviour of checking for a Schemas table, comparing versions, and running database schema update scripts. This is for cases where an extension is using a database from another system, and should not attempt to manage the database schema.

CreateProvider<TDataProvider>

CreateProvider<TDataProvider> ()
Create a new instance of the specified data provider interface, after checking whether migration scripts need to be applied.
Type Parameters
TDataProvider
Returns
A data provider instance of the specified type.
Remarks
If migration scripts exist which have not been applied, scripts are automatically executed before returning the data provider object. Migration script checks are not run again until after a restart.