Class AbpDbContext<TDbContext>
Inheritance
AbpDbContext<TDbContext>
Implements
IDbContextDependencies
IDbSetCache
IDbContextPoolable
IResettableService
Assembly: Volo.Abp.EntityFrameworkCore.dll
Syntax
public abstract class AbpDbContext<TDbContext> : DbContext, IAbpEfCoreDbContext, IEfCoreDbContext, IDisposable, IInfrastructure<IServiceProvider>, IDbContextDependencies, IDbSetCache, IDbContextPoolable, IResettableService, IAsyncDisposable, IAbpEfCoreDbFunctionContext, ITransientDependency where TDbContext : DbContext
Type Parameters
Name |
Description |
TDbContext |
|
Constructors
AbpDbContext(DbContextOptions<TDbContext>)
Declaration
protected AbpDbContext(DbContextOptions<TDbContext> options)
Parameters
Type |
Name |
Description |
DbContextOptions<TDbContext> |
options |
|
Fields
DbContextOptions
Declaration
protected readonly DbContextOptions DbContextOptions
Field Value
Type |
Description |
DbContextOptions |
|
Properties
AbpEfCoreNavigationHelper
Declaration
public AbpEfCoreNavigationHelper AbpEfCoreNavigationHelper { get; }
Property Value
AuditPropertySetter
Declaration
public IAuditPropertySetter AuditPropertySetter { get; }
Property Value
AuditingManager
Declaration
public IAuditingManager AuditingManager { get; }
Property Value
Clock
Declaration
public IClock Clock { get; }
Property Value
CurrentTenant
Declaration
public ICurrentTenant CurrentTenant { get; }
Property Value
CurrentTenantId
Declaration
protected virtual Guid? CurrentTenantId { get; }
Property Value
DataFilter
Declaration
public IDataFilter DataFilter { get; }
Property Value
DistributedEventBus
Declaration
public IDistributedEventBus DistributedEventBus { get; }
Property Value
EntityChangeEventHelper
Declaration
public IEntityChangeEventHelper EntityChangeEventHelper { get; }
Property Value
EntityChangeOptions
Declaration
public IOptions<AbpEntityChangeOptions> EntityChangeOptions { get; }
Property Value
EntityHistoryHelper
Declaration
public IEntityHistoryHelper EntityHistoryHelper { get; }
Property Value
GlobalFilterOptions
Declaration
public IOptions<AbpEfCoreGlobalFilterOptions> GlobalFilterOptions { get; }
Property Value
GuidGenerator
Declaration
public IGuidGenerator GuidGenerator { get; }
Property Value
IsMultiTenantFilterEnabled
Declaration
protected virtual bool IsMultiTenantFilterEnabled { get; }
Property Value
IsSoftDeleteFilterEnabled
Declaration
protected virtual bool IsSoftDeleteFilterEnabled { get; }
Property Value
LazyServiceProvider
Declaration
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
Property Value
LocalEventBus
Declaration
public ILocalEventBus LocalEventBus { get; }
Property Value
Logger
Declaration
public ILogger<AbpDbContext<TDbContext>> Logger { get; }
Property Value
Options
Declaration
public IOptions<AbpDbContextOptions> Options { get; }
Property Value
UnitOfWorkManager
Declaration
public IUnitOfWorkManager UnitOfWorkManager { get; }
Property Value
Methods
ApplyAbpConceptsForAddedEntity(EntityEntry)
Declaration
protected virtual void ApplyAbpConceptsForAddedEntity(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
ApplyAbpConceptsForDeletedEntity(EntityEntry)
Declaration
protected virtual void ApplyAbpConceptsForDeletedEntity(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
ApplyAbpConceptsForModifiedEntity(EntityEntry, bool)
Declaration
protected virtual void ApplyAbpConceptsForModifiedEntity(EntityEntry entry, bool forceApply = false)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
bool |
forceApply |
|
ChangeTracker_StateChanged(object?, EntityStateChangedEventArgs)
Declaration
protected virtual void ChangeTracker_StateChanged(object? sender, EntityStateChangedEventArgs e)
Parameters
Type |
Name |
Description |
object |
sender |
|
EntityStateChangedEventArgs |
e |
|
ChangeTracker_Tracked(object?, EntityTrackedEventArgs)
Declaration
protected virtual void ChangeTracker_Tracked(object? sender, EntityTrackedEventArgs e)
Parameters
Type |
Name |
Description |
object |
sender |
|
EntityTrackedEventArgs |
e |
|
CheckAndSetId(EntityEntry)
Declaration
protected virtual void CheckAndSetId(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
ConfigureBaseProperties<TEntity>(ModelBuilder, IMutableEntityType)
Declaration
protected virtual void ConfigureBaseProperties<TEntity>(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType) where TEntity : class
Parameters
Type |
Name |
Description |
ModelBuilder |
modelBuilder |
|
IMutableEntityType |
mutableEntityType |
|
Type Parameters
ConfigureConventions(ModelConfigurationBuilder)
Declaration
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
Parameters
Type |
Name |
Description |
ModelConfigurationBuilder |
configurationBuilder |
|
ConfigureGlobalFilters<TEntity>(ModelBuilder, IMutableEntityType)
Declaration
protected virtual void ConfigureGlobalFilters<TEntity>(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType) where TEntity : class
Parameters
Type |
Name |
Description |
ModelBuilder |
modelBuilder |
|
IMutableEntityType |
mutableEntityType |
|
Type Parameters
ConfigureValueConverter<TEntity>(ModelBuilder, IMutableEntityType)
Declaration
protected virtual void ConfigureValueConverter<TEntity>(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType) where TEntity : class
Parameters
Type |
Name |
Description |
ModelBuilder |
modelBuilder |
|
IMutableEntityType |
mutableEntityType |
|
Type Parameters
ConfigureValueGenerated<TEntity>(ModelBuilder, IMutableEntityType)
Declaration
protected virtual void ConfigureValueGenerated<TEntity>(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType) where TEntity : class
Parameters
Type |
Name |
Description |
ModelBuilder |
modelBuilder |
|
IMutableEntityType |
mutableEntityType |
|
Type Parameters
CreateEventReport()
Declaration
protected virtual EntityEventReport CreateEventReport()
Returns
CreateFilterExpression<TEntity>(ModelBuilder)
Declaration
protected virtual Expression<Func<TEntity, bool>>? CreateFilterExpression<TEntity>(ModelBuilder modelBuilder) where TEntity : class
Parameters
Type |
Name |
Description |
ModelBuilder |
modelBuilder |
|
Returns
Type Parameters
Declaration
protected virtual void FillExtraPropertiesForTrackedEntities(EntityTrackedEventArgs e)
Parameters
Type |
Name |
Description |
EntityTrackedEventArgs |
e |
|
GetCompiledQueryCacheKey()
Declaration
public virtual string GetCompiledQueryCacheKey()
Returns
GetDatabaseProviderOrNull(ModelBuilder)
Declaration
protected virtual EfCoreDatabaseProvider? GetDatabaseProviderOrNull(ModelBuilder modelBuilder)
Parameters
Type |
Name |
Description |
ModelBuilder |
modelBuilder |
|
Returns
HandleExtraPropertiesOnSave(EntityEntry)
Declaration
protected virtual void HandleExtraPropertiesOnSave(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
HandlePropertiesBeforeSave()
Declaration
protected virtual void HandlePropertiesBeforeSave()
IncrementEntityVersionProperty(EntityEntry)
Declaration
protected virtual void IncrementEntityVersionProperty(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
Initialize(AbpEfCoreDbContextInitializationContext)
Declaration
public virtual void Initialize(AbpEfCoreDbContextInitializationContext initializationContext)
Parameters
IsHardDeleted(EntityEntry)
Declaration
protected virtual bool IsHardDeleted(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
Returns
OnConfiguring(DbContextOptionsBuilder)
Declaration
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
Parameters
Type |
Name |
Description |
DbContextOptionsBuilder |
optionsBuilder |
|
OnModelCreating(ModelBuilder)
Declaration
protected override void OnModelCreating(ModelBuilder modelBuilder)
Parameters
Type |
Name |
Description |
ModelBuilder |
modelBuilder |
|
PublishEntityEvents(EntityEventReport)
Declaration
protected virtual void PublishEntityEvents(EntityEventReport changeReport)
Parameters
PublishEventsForTrackedEntity(EntityEntry)
Declaration
protected virtual void PublishEventsForTrackedEntity(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
SaveChangesAsync(bool, CancellationToken)
Declaration
public override Task<int> SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default)
Parameters
Returns
SaveChangesOnDbContextAsync(bool, CancellationToken)
Declaration
public virtual Task<int> SaveChangesOnDbContextAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default)
Parameters
Returns
SetConcurrencyStampIfNull(EntityEntry)
Declaration
protected virtual void SetConcurrencyStampIfNull(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
SetCreationAuditProperties(EntityEntry)
Declaration
protected virtual void SetCreationAuditProperties(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
SetDeletionAuditProperties(EntityEntry)
Declaration
protected virtual void SetDeletionAuditProperties(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
SetModificationAuditProperties(EntityEntry)
Declaration
protected virtual void SetModificationAuditProperties(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
ShouldFilterEntity<TEntity>(IMutableEntityType)
Declaration
protected virtual bool ShouldFilterEntity<TEntity>(IMutableEntityType entityType) where TEntity : class
Parameters
Type |
Name |
Description |
IMutableEntityType |
entityType |
|
Returns
Type Parameters
TrySetDatabaseProvider(ModelBuilder)
Declaration
protected virtual void TrySetDatabaseProvider(ModelBuilder modelBuilder)
Parameters
Type |
Name |
Description |
ModelBuilder |
modelBuilder |
|
TrySetGuidId(EntityEntry, IEntity<Guid>)
Declaration
protected virtual void TrySetGuidId(EntityEntry entry, IEntity<Guid> entity)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
IEntity<Guid> |
entity |
|
UpdateConcurrencyStamp(EntityEntry)
Declaration
protected virtual void UpdateConcurrencyStamp(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
UseDbFunction()
Declaration
protected virtual bool UseDbFunction()
Returns
Implements
Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<>
Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies
Microsoft.EntityFrameworkCore.Internal.IDbSetCache
Microsoft.EntityFrameworkCore.Internal.IDbContextPoolable
Microsoft.EntityFrameworkCore.Infrastructure.IResettableService
Extension Methods