Context. On Configuring(DbContextOptionsBuilder) Method
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Override this method to configure the database (and other options) to be used for this context. This method is called for each instance of the context that is created. The base implementation does nothing.
protected internal virtual void OnConfiguring (Microsoft.EntityFrameworkCore.DbContextOptionsBuilder optionsBuilder);
abstract member OnConfiguring : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder -> unit override this.OnConfiguring : Microsoft.EntityFrameworkCore.DbContextOptionsBuilder -> unit
Protected Friend Overridable Sub OnConfiguring (optionsBuilder As DbContextOptionsBuilder)
A builder used to create or modify options for this context. Databases (and other extensions) typically define extension methods on this object that allow you to configure the context.
In situations where an instance of DbContextOptions may or may not have been passed to the constructor, you can use IsConfigured to determine if the options have already been set, and skip some or all of the logic in OnConfiguring(DbContextOptionsBuilder).
See DbContext lifetime, configuration, and initialization for more information and examples.
Submit and view feedback for