DbContextOptions<TContext> Class
Definition
Important
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.
The options to be used by a DbContext. You normally override OnConfiguring(DbContextOptionsBuilder) or use a DbContextOptionsBuilder<TContext> to create instances of this class and it is not designed to be directly constructed in your application code.
public class DbContextOptions<TContext> : Microsoft.EntityFrameworkCore.DbContextOptions where TContext : DbContext
type DbContextOptions<'Context (requires 'Context :> DbContext)> = class
inherit DbContextOptions
Public Class DbContextOptions(Of TContext)
Inherits DbContextOptions
Type Parameters
- TContext
The type of the context these options apply to.
- Inheritance
Remarks
See Using DbContextOptions for more information and examples.
Constructors
DbContextOptions<TContext>() |
Initializes a new instance of the DbContextOptions<TContext> class. You normally override OnConfiguring(DbContextOptionsBuilder) or use a DbContextOptionsBuilder<TContext> to create instances of this class and it is not designed to be directly constructed in your application code. |
DbContextOptions<TContext>(IReadOnlyDictionary<Type,IDbContextOptionsExtension>) |
Initializes a new instance of the DbContextOptions<TContext> class. You normally override OnConfiguring(DbContextOptionsBuilder) or use a DbContextOptionsBuilder<TContext> to create instances of this class and it is not designed to be directly constructed in your application code. |
Properties
ContextType |
The type of context that these options are for ( |
Extensions |
Gets the extensions that store the configured options. (Inherited from DbContextOptions) |
ExtensionsMap |
This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release. (Inherited from DbContextOptions) |
IsFrozen |
Returns |
Methods
Equals(DbContextOptions) |
Determines whether the specified object is equal to the current object. (Inherited from DbContextOptions) |
Equals(Object) | (Inherited from DbContextOptions) |
FindExtension<TExtension>() |
Gets the extension of the specified type. Returns |
Freeze() |
Specifies that no further configuration of this options object should occur. (Inherited from DbContextOptions) |
GetExtension<TExtension>() |
Gets the extension of the specified type. Throws if no extension of the specified type is configured. (Inherited from DbContextOptions) |
GetHashCode() | (Inherited from DbContextOptions) |
WithExtension<TExtension>(TExtension) |
Adds the given extension to the underlying options and creates a new DbContextOptions with the extension added. |
Applies to
Entity Framework