CoreOptionsExtension 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.
Represents options managed by the core of Entity Framework, as opposed to those managed by database providers or extensions. These options are set using DbContextOptionsBuilder.
Instances of this class are designed to be immutable. To change an option, call one of the 'With...' methods to obtain a new instance with the option changed.
public class CoreOptionsExtension : Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptionsExtension
public class CoreOptionsExtension : Microsoft.EntityFrameworkCore.Infrastructure.IDbContextOptionsExtensionWithDebugInfo
type CoreOptionsExtension = class
interface IDbContextOptionsExtension
type CoreOptionsExtension = class
interface IDbContextOptionsExtensionWithDebugInfo
interface IDbContextOptionsExtension
Public Class CoreOptionsExtension
Implements IDbContextOptionsExtension
Public Class CoreOptionsExtension
Implements IDbContextOptionsExtensionWithDebugInfo
- Inheritance
-
CoreOptionsExtension
- Implements
Remarks
See Implementation of database providers and extensions for more information and examples.
Constructors
CoreOptionsExtension() |
Creates a new set of options with everything set to default values. |
CoreOptionsExtension(CoreOptionsExtension) |
Called by a derived class constructor when implementing the Clone() method. |
Properties
Methods
ApplyServices(IServiceCollection) |
Adds the services required to make the selected options work. This is used when there is no external IServiceProvider and EF is maintaining its own service provider internally. This allows database providers (and other extensions) to register their required services when EF is creating an service provider. |
Clone() |
Override this method in a derived class to ensure that any clone created is also of that class. |
GetServiceProviderHashCode() |
Returns a hash code created from any options that would cause a new IServiceProvider to be needed. |
PopulateDebugInfo(IDictionary<String,String>) |
Populates a dictionary of information that may change between uses of the
extension such that it can be compared to a previous configuration for
this option and differences can be logged. The dictionary key prefix
|
Validate(IDbContextOptions) |
Gives the extension a chance to validate that all options in the extension are valid. If options are invalid, then an exception will be thrown. |
WithApplicationServiceProvider(IServiceProvider) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithAsyncSeeding(Func<DbContext,Boolean,CancellationToken,Task>) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithDbContextLogger(IDbContextLogger) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithDetailedErrorsEnabled(Boolean) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithInterceptors(IEnumerable<IInterceptor>) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithInternalServiceProvider(IServiceProvider) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithLoggerFactory(ILoggerFactory) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithLoggingCacheTime(TimeSpan) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithMaxPoolSize(Nullable<Int32>) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithMemoryCache(IMemoryCache) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithModel(IModel) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithQueryTrackingBehavior(QueryTrackingBehavior) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithReplacedService(Type, Type, Type) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithReplacedService(Type, Type) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithRootApplicationServiceProvider(Boolean) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithRootApplicationServiceProvider(IServiceProvider) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithSeeding(Action<DbContext,Boolean>) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithSensitiveDataLoggingEnabled(Boolean) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithServiceProviderCachingEnabled(Boolean) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithSingletonInterceptors(IEnumerable<ISingletonInterceptor>) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithThreadSafetyChecksEnabled(Boolean) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
WithWarningsConfiguration(WarningsConfiguration) |
Creates a new instance with all options the same as for this instance, but with the given option changed. It is unusual to call this method directly. Instead use DbContextOptionsBuilder. |
Applies to
Entity Framework