DbContextOptions DbContextOptions Class

Definition

The options to be used by a DbContext. You normally override OnConfiguring(DbContextOptionsBuilder) or use a DbContextOptionsBuilder to create instances of this class and it is not designed to be directly constructed in your application code.

public abstract class DbContextOptions : IDbContextOptions
Public MustInherit Class DbContextOptions
    Implements IDbContextOptions
Inheritance
System.ObjectSystem.Object
DbContextOptionsDbContextOptions
Implements

Constructors

DbContextOptions(IReadOnlyDictionary<Type, IDbContextOptionsExtension>) DbContextOptions(IReadOnlyDictionary(Of Type, IDbContextOptionsExtension))

Initializes a new instance of the DbContextOptions class. You normally override OnConfiguring(DbContextOptionsBuilder) or use a DbContextOptionsBuilder to create instances of this class and it is not designed to be directly constructed in your application code.

Properties

ContextType ContextType

The type of context that these options are for. Will return DbContext if the options are not built for a specific derived context.

Extensions Extensions

Gets the extensions that store the configured options.

Methods

System.Object.Equals(System.Object) System.Object.Equals(System.Object) Inherited from System.Object
System.Object.Equals(System.Object, System.Object) System.Object.Equals(System.Object, System.Object) Inherited from System.Object
FindExtension<TExtension>() FindExtension(Of TExtension)()

Gets the extension of the specified type. Returns null if no extension of the specified type is configured.

GetExtension<TExtension>() GetExtension(Of TExtension)()

Gets the extension of the specified type. Throws if no extension of the specified type is configured.

System.Object.GetHashCode() System.Object.GetHashCode() Inherited from System.Object
System.Object.GetType() System.Object.GetType() Inherited from System.Object
System.Object.MemberwiseClone() System.Object.MemberwiseClone() Inherited from System.Object
System.Object.ReferenceEquals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) Inherited from System.Object
System.Object.ToString() System.Object.ToString() Inherited from System.Object
WithExtension<TExtension>(TExtension) WithExtension(Of TExtension)(TExtension)

Adds the given extension to the options.