DbContextOptions<TContext> DbContextOptions(Of TContext) Class

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.

Syntax

Declaration

public class DbContextOptions<TContext> : DbContextOptions, IDbContextOptions where TContext : DbContextPublic Class DbContextOptions(Of TContext As DbContext)
    Inherits DbContextOptions
    Implements IDbContextOptions

Type Parameters

TContext The type of the context these options apply to.

Inheritance Hierarchy

Inherited Members

Extensions,
Extensions,
FindExtension<TExtension>(),
FindExtension(Of TExtension)(),
GetExtension<TExtension>(),
GetExtension(Of TExtension)(),
ToString(),
ToString(),
Equals(Object),
Equals(Object),
Equals(Object, Object),
Equals(Object, Object),
ReferenceEquals(Object, Object),
ReferenceEquals(Object, Object),
GetHashCode(),
GetHashCode(),
GetType(),
GetType(),
MemberwiseClone()
MemberwiseClone()

Constructors summary

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.

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 summary

The type of context that these options are for (TContext).

Methods summary

Adds the given extension to the options.

Constructors

  • DbContextOptions()
    DbContextOptions()

    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.

    public DbContextOptions()Public Sub New
  • DbContextOptions(IReadOnlyDictionary<Type, IDbContextOptionsExtension>)
    DbContextOptions(IReadOnlyDictionary(Of 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.

    public DbContextOptions(IReadOnlyDictionary<Type, IDbContextOptionsExtension> extensions)Public Sub New(extensions As IReadOnlyDictionary(Of Type, IDbContextOptionsExtension))

    Parameters

    • extensions
      System.Collections.Generic.IReadOnlyDictionary<TKey, TValue><System.Type, IDbContextOptionsExtension>
      System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>(Of System.Type, IDbContextOptionsExtension)

      The extensions that store the configured options.

Properties

  • ContextType
    ContextType

    The type of context that these options are for (TContext).

    public override Type ContextType { get; }Public Overrides ReadOnly Property ContextType As Type

    Property Value

    • System.Type
      System.Type

Methods

  • WithExtension<TExtension>(TExtension)
    WithExtension(Of TExtension)(TExtension)

    Adds the given extension to the options.

    public override DbContextOptions WithExtension<TExtension>(TExtension extension)where TExtension : class, IDbContextOptionsExtensionPublic Overrides Function WithExtension(Of TExtension As {Class, IDbContextOptionsExtension})(extension As TExtension) As DbContextOptions

    Parameters

    • extension
      TExtension
      TExtension

      The extension to be added.

    Returns

Details

Assembly

Microsoft.EntityFrameworkCore.dll