Nucleus .Net Core CMS

DataProviderExtensions Class

Namespace: Nucleus.Data.Common
Assembly: Nucleus.Data.Common.dll
Common data provider dependency injection registration extension methods.

Methods

AddDataProvider<TDataProvider> (IServiceCollection,IConfiguration) Method

AddDataProvider<TDataProvider> (IServiceCollection services, IConfiguration configuration)
Add data provider objects to the service collection for the data provider specified by TDataProvider. This overload uses the default schema name for the data provider type.
Type Parameters
TDataProvider
Remarks
Data providers which are based on Nucleus.Data.EntityFramework do not need to call this directly - it is called by the Nucleus.Data.EntityFramework.DataProviderExtensions.AddDataProvider() methods.

AddDataProvider<TDataProvider> (IServiceCollection,IConfiguration,String) Method

AddDataProvider<TDataProvider> (IServiceCollection services, IConfiguration configuration, String schemaName)
Add data provider objects to the service collection for the data provider specified by TDataProvider. This overload allows callers to specify their schema name instead of using the default.
Type Parameters
TDataProvider
Remarks
Data providers which are based on Nucleus.Data.EntityFramework do not need to call this directly - it is called by the Nucleus.Data.EntityFramework.DataProviderExtensions.AddDataProvider() methods.

GetDataProviderInformation (IServiceProvider,String) Method

GetDataProviderInformation (IServiceProvider services, String schemaName)
Get database diagnostics information for the specified schema.
Parameters
Name Type
services IServiceProvider
schemaName String

AddDataProviderFactory (IServiceCollection,IConfiguration) Method

AddDataProviderFactory (IServiceCollection services, IConfiguration configuration)
Add the default data provider factory to the services collection.

GetDefaultSchemaName (Type) Method

GetDefaultSchemaName (Type type)
Return the default namespace for a type.
Parameters
Name Type
type Type
Remarks
The specified type would typically be a data provider. The default schema name is derived by returning the part of the namespace before ".DataProvider". If the namespace does not contain ".DataProvider", this function returns an empty string. The convention for modules is to us a namespace with ".DataProviders" (plural), but using ".DataProvider" (singular) as the search value handles both plural and singular cases.