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.
Implementations of IDbContextConfigurator should use the generic form of DbContextConfigurator<TDataProvider>.
Gets the database connection option for this DbContextConfigurator.
Gets the tokens and values which were matched in the most recent call to ParseException.
Dictionary of constraint names/messages for ParseException 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.
ParseException (Microsoft.EntityFrameworkCore.DbUpdateException)
Parse a database exception and if recognized, throw an exception with a more friendly message.
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
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.