ExtensibleDbContext Class
Assembly: PTS.EntityLayer.Extensibility.dll
Base context that serves as provider for entity services.
Syntax
public class ExtensibleDbContext : DbContext, IDisposable, IAsyncDisposable, IInfrastructure<IServiceProvider>, IDbContextDependencies, IDbSetCache, IDbContextPoolable, IResettableService, IEntityServiceProvider
Inheritance
System.Object
Microsoft.EntityFrameworkCore.DbContext
ExtensibleDbContext
Implements
System.IDisposable
System.IAsyncDisposable
Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>
Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies
Microsoft.EntityFrameworkCore.Internal.IDbSetCache
Microsoft.EntityFrameworkCore.Internal.IDbContextPoolable
Microsoft.EntityFrameworkCore.Infrastructure.IResettableService
Constructors
ExtensibleDbContext(DbContextOptions)
Declaration
public ExtensibleDbContext(DbContextOptions options)
Parameters
Type |
Name |
Description |
Microsoft.EntityFrameworkCore.DbContextOptions |
options |
The options for this context.
|
Methods
Dispose()
Releases the allocated resources for this context and its entity service provider.
Declaration
public override void Dispose()
Overrides
Microsoft.EntityFrameworkCore.DbContext.Dispose()
GetEntityService<TService>()
Get entity service of specified generic type.
Declaration
public TService GetEntityService<TService>()
Returns
Type |
Description |
TService |
A service of specified generic type.
|
Type Parameters
Name |
Description |
TService |
The type of service to get.
|
Exceptions
Type |
Condition |
System.MissingMemberException |
Thrown if the specified service was not found.
|
OnConfiguring(DbContextOptionsBuilder)
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.
In situations where an instance of Microsoft.EntityFrameworkCore.DbContextOptions may or may not have been passed
to the constructor, you can use Microsoft.EntityFrameworkCore.DbContextOptionsBuilder.IsConfigured to determine if
the options have already been set, and skip some or all of the logic in
Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder).
Declaration
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
Parameters
Type |
Name |
Description |
Microsoft.EntityFrameworkCore.DbContextOptionsBuilder |
optionsBuilder |
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.
|
Overrides
Microsoft.EntityFrameworkCore.DbContext.OnConfiguring(Microsoft.EntityFrameworkCore.DbContextOptionsBuilder)
OnEntityModelCreated(ModelBuilder)
Override this method to further configure the model that was discovered by convention from the entity types
exposed in properties on your derived context. The resulting model may be cached
and re-used for subsequent instances of your derived context.
Declaration
protected virtual void OnEntityModelCreated(ModelBuilder modelBuilder)
Parameters
Type |
Name |
Description |
Microsoft.EntityFrameworkCore.ModelBuilder |
modelBuilder |
The builder being used to construct the model for this context. Databases (and other extensions) typically
define extension methods on this object that allow you to configure aspects of the model that are specific
to a given database.
|
OnModelCreating(ModelBuilder)
Configures the model that was discovered by convention from the entity types
exposed in properties in current context type.
Declaration
protected override sealed void OnModelCreating(ModelBuilder modelBuilder)
Parameters
Type |
Name |
Description |
Microsoft.EntityFrameworkCore.ModelBuilder |
modelBuilder |
The builder being used to construct the model for this context. Databases (and other extensions) typically
define extension methods on this object that allow you to configure aspects of the model that are specific
to a given database.
|
Overrides
Microsoft.EntityFrameworkCore.DbContext.OnModelCreating(Microsoft.EntityFrameworkCore.ModelBuilder)
Implements
System.IDisposable
System.IAsyncDisposable
Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<T>
Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies
Microsoft.EntityFrameworkCore.Internal.IDbSetCache
Microsoft.EntityFrameworkCore.Internal.IDbContextPoolable
Microsoft.EntityFrameworkCore.Infrastructure.IResettableService
Inherited Members
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbSetCache.GetOrAddSet(Microsoft.EntityFrameworkCore.Internal.IDbSetSource, System.Type)
Microsoft.EntityFrameworkCore.DbContext.Set<TEntity>()
Microsoft.EntityFrameworkCore.DbContext.Query<TQuery>()
Microsoft.EntityFrameworkCore.DbContext.SaveChanges()
Microsoft.EntityFrameworkCore.DbContext.SaveChanges(System.Boolean)
Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(System.Boolean, System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextPoolable.SetPool(Microsoft.EntityFrameworkCore.Internal.IDbContextPool)
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextPoolable.SnapshotConfiguration()
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextPoolable.Resurrect(Microsoft.EntityFrameworkCore.Internal.DbContextPoolConfigurationSnapshot)
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IResettableService.ResetState()
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IResettableService.ResetStateAsync(System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.DisposeAsync()
Microsoft.EntityFrameworkCore.DbContext.Entry<TEntity>(TEntity)
Microsoft.EntityFrameworkCore.DbContext.Entry(System.Object)
Microsoft.EntityFrameworkCore.DbContext.Add<TEntity>(TEntity)
Microsoft.EntityFrameworkCore.DbContext.AddAsync<TEntity>(TEntity, System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.Attach<TEntity>(TEntity)
Microsoft.EntityFrameworkCore.DbContext.Update<TEntity>(TEntity)
Microsoft.EntityFrameworkCore.DbContext.Remove<TEntity>(TEntity)
Microsoft.EntityFrameworkCore.DbContext.Add(System.Object)
Microsoft.EntityFrameworkCore.DbContext.AddAsync(System.Object, System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.Attach(System.Object)
Microsoft.EntityFrameworkCore.DbContext.Update(System.Object)
Microsoft.EntityFrameworkCore.DbContext.Remove(System.Object)
Microsoft.EntityFrameworkCore.DbContext.AddRange(System.Object[])
Microsoft.EntityFrameworkCore.DbContext.AddRangeAsync(System.Object[])
Microsoft.EntityFrameworkCore.DbContext.AttachRange(System.Object[])
Microsoft.EntityFrameworkCore.DbContext.UpdateRange(System.Object[])
Microsoft.EntityFrameworkCore.DbContext.RemoveRange(System.Object[])
Microsoft.EntityFrameworkCore.DbContext.AddRange(System.Collections.Generic.IEnumerable<System.Object>)
Microsoft.EntityFrameworkCore.DbContext.AddRangeAsync(System.Collections.Generic.IEnumerable<System.Object>, System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.AttachRange(System.Collections.Generic.IEnumerable<System.Object>)
Microsoft.EntityFrameworkCore.DbContext.UpdateRange(System.Collections.Generic.IEnumerable<System.Object>)
Microsoft.EntityFrameworkCore.DbContext.RemoveRange(System.Collections.Generic.IEnumerable<System.Object>)
Microsoft.EntityFrameworkCore.DbContext.Find(System.Type, System.Object[])
Microsoft.EntityFrameworkCore.DbContext.FindAsync(System.Type, System.Object[])
Microsoft.EntityFrameworkCore.DbContext.FindAsync(System.Type, System.Object[], System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.Find<TEntity>(System.Object[])
Microsoft.EntityFrameworkCore.DbContext.FindAsync<TEntity>(System.Object[])
Microsoft.EntityFrameworkCore.DbContext.FindAsync<TEntity>(System.Object[], System.Threading.CancellationToken)
Microsoft.EntityFrameworkCore.DbContext.Database
Microsoft.EntityFrameworkCore.DbContext.ChangeTracker
Microsoft.EntityFrameworkCore.DbContext.Model
Microsoft.EntityFrameworkCore.DbContext.ContextId
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.SetSource
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.EntityFinderFactory
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.QueryProvider
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.StateManager
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.ChangeDetector
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.EntityGraphAttacher
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.UpdateLogger
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies.InfrastructureLogger
Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>.Instance
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Extension Methods
See Also
Microsoft.EntityFrameworkCore.DbContext