Nucleus .Net Core CMS

DbContextConfigurator Class

Namespace: Nucleus.Data.EntityFramework
Assembly: Nucleus.Data.EntityFramework.dll
This is the non-generic form of IDbContextConfigurator, used by DbContext.

Remarks

Implementations of IDbContextConfigurator should use the generic form of DbContextConfigurator<TDataProvider>.

Properties

DatabaseConnectionOption Property

Gets the database connection option for this DbContextConfigurator.

ExceptionMessageTokens Property

Gets the tokens and values which were matched in the most recent call to ParseException.

Fields

DB_MESSAGES Field

Dictionary of constraint names/messages for ParseException method.

Methods

Configure (DbContextOptionsBuilder) Method

Configure (DbContextOptionsBuilder options)
Configure entity-framework with the specified options.
Remarks
Entity-framework base database providers implement this method to call the initialization methods which are appropriate to their specific implementation.

PreConfigure

PreConfigure ()
Perform (or retry) pre-configuration checks.
Remarks
Implementation of this method is optional, database providers often don't need to execute any checks. An example of a pre-configuration check is the SQLite database provider, which checks that the folder which will store the database exists, and creates it if it does not.

ParseException (DbUpdateException) Method

ParseException (Microsoft.EntityFrameworkCore.DbUpdateException)
Parse a database exception and if recognized, throw an exception with a more friendly message.

ParseException (Exception,String,String) Method

ParseException (Exception exception, String pattern, String message)
Match an original exception message to a pattern and generate an improved error message.
Parameters
Name Type
exception Exception
pattern String
message String