Class AbpDbContext<TDbContext>
Inheritance
object
AbpDbContext<TDbContext>
Implements
System.IDisposable
Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<><System.IServiceProvider>
Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies
Microsoft.EntityFrameworkCore.Internal.IDbSetCache
Microsoft.EntityFrameworkCore.Internal.IDbContextPoolable
Microsoft.EntityFrameworkCore.Infrastructure.IResettableService
System.IAsyncDisposable
Assembly: Volo.Abp.EntityFrameworkCore.dll
Syntax
public abstract class AbpDbContext<TDbContext> : DbContext, IAbpEfCoreDbContext, IEfCoreDbContext, IDisposable, IInfrastructure<IServiceProvider>, IDbContextDependencies, IDbSetCache, IDbContextPoolable, IResettableService, IAsyncDisposable, ITransientDependency where TDbContext : DbContext
Type Parameters
| Name |
Description |
| TDbContext |
|
Constructors
AbpDbContext(DbContextOptions<TDbContext>)
Declaration
protected AbpDbContext(DbContextOptions<TDbContext> options)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.DbContextOptions<><TDbContext> |
options |
|
Properties
AuditingManager
Declaration
public IAuditingManager AuditingManager { get; }
Property Value
AuditPropertySetter
Declaration
public IAuditPropertySetter AuditPropertySetter { 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
| Type |
Description |
| System.Guid? |
|
DataFilter
Declaration
public IDataFilter DataFilter { get; }
Property Value
DistributedEventBus
Declaration
public IDistributedEventBus DistributedEventBus { get; }
Property Value
EntityChangeEventHelper
Declaration
public IEntityChangeEventHelper EntityChangeEventHelper { get; }
Property Value
EntityHistoryHelper
Declaration
public IEntityHistoryHelper EntityHistoryHelper { 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
| Type |
Description |
| Microsoft.Extensions.Logging.ILogger<TCategoryName><AbpDbContext<TDbContext>> |
|
UnitOfWorkManager
Declaration
public IUnitOfWorkManager UnitOfWorkManager { get; }
Property Value
Methods
ApplyAbpConceptsForAddedEntity(EntityEntry)
Declaration
protected virtual void ApplyAbpConceptsForAddedEntity(EntityEntry entry)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry |
entry |
|
ApplyAbpConceptsForDeletedEntity(EntityEntry)
Declaration
protected virtual void ApplyAbpConceptsForDeletedEntity(EntityEntry entry)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry |
entry |
|
ApplyAbpConceptsForModifiedEntity(EntityEntry)
Declaration
protected virtual void ApplyAbpConceptsForModifiedEntity(EntityEntry entry)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry |
entry |
|
ChangeTracker_StateChanged(object, EntityStateChangedEventArgs)
Declaration
protected virtual void ChangeTracker_StateChanged(object sender, EntityStateChangedEventArgs e)
Parameters
| Type |
Name |
Description |
| object |
sender |
|
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityStateChangedEventArgs |
e |
|
ChangeTracker_Tracked(object, EntityTrackedEventArgs)
Declaration
protected virtual void ChangeTracker_Tracked(object sender, EntityTrackedEventArgs e)
Parameters
| Type |
Name |
Description |
| object |
sender |
|
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityTrackedEventArgs |
e |
|
CheckAndSetId(EntityEntry)
Declaration
protected virtual void CheckAndSetId(EntityEntry entry)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry |
entry |
|
CombineExpressions<T>(Expression<Func<T, bool>>, Expression<Func<T, bool>>)
Declaration
protected virtual Expression<Func<T, bool>> CombineExpressions<T>(Expression<Func<T, bool>> expression1, Expression<Func<T, bool>> expression2)
Parameters
| Type |
Name |
Description |
| System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><T, bool>> |
expression1 |
|
| System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><T, bool>> |
expression2 |
|
Returns
| Type |
Description |
| System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><T, bool>> |
|
Type Parameters
ConfigureBaseProperties<TEntity>(ModelBuilder, IMutableEntityType)
Declaration
protected virtual void ConfigureBaseProperties<TEntity>(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType) where TEntity : class
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ModelBuilder |
modelBuilder |
|
| Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType |
mutableEntityType |
|
Type Parameters
ConfigureGlobalFilters<TEntity>(ModelBuilder, IMutableEntityType)
Declaration
protected virtual void ConfigureGlobalFilters<TEntity>(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType) where TEntity : class
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ModelBuilder |
modelBuilder |
|
| Microsoft.EntityFrameworkCore.Metadata.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 |
| Microsoft.EntityFrameworkCore.ModelBuilder |
modelBuilder |
|
| Microsoft.EntityFrameworkCore.Metadata.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 |
| Microsoft.EntityFrameworkCore.ModelBuilder |
modelBuilder |
|
| Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType |
mutableEntityType |
|
Type Parameters
CreateEventReport()
Declaration
protected virtual EntityEventReport CreateEventReport()
Returns
CreateFilterExpression<TEntity>()
Declaration
protected virtual Expression<Func<TEntity, bool>> CreateFilterExpression<TEntity>() where TEntity : class
Returns
| Type |
Description |
| System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><TEntity, bool>> |
|
Type Parameters
Declaration
protected virtual void FillExtraPropertiesForTrackedEntities(EntityTrackedEventArgs e)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityTrackedEventArgs |
e |
|
GetDatabaseProviderOrNull(ModelBuilder)
Declaration
protected virtual EfCoreDatabaseProvider? GetDatabaseProviderOrNull(ModelBuilder modelBuilder)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ModelBuilder |
modelBuilder |
|
Returns
HandleExtraPropertiesOnSave(EntityEntry)
Declaration
protected virtual void HandleExtraPropertiesOnSave(EntityEntry entry)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry |
entry |
|
HandlePropertiesBeforeSave()
Declaration
protected virtual void HandlePropertiesBeforeSave()
Initialize(AbpEfCoreDbContextInitializationContext)
Declaration
public virtual void Initialize(AbpEfCoreDbContextInitializationContext initializationContext)
Parameters
IsHardDeleted(EntityEntry)
Declaration
protected virtual bool IsHardDeleted(EntityEntry entry)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry |
entry |
|
Returns
OnModelCreating(ModelBuilder)
Declaration
protected override void OnModelCreating(ModelBuilder modelBuilder)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ModelBuilder |
modelBuilder |
|
SaveChangesAsync(bool, CancellationToken)
Declaration
public override Task<int> SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default)
Parameters
| Type |
Name |
Description |
| bool |
acceptAllChangesOnSuccess |
|
| System.Threading.CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task<TResult><int> |
|
SaveChangesOnDbContextAsync(bool, CancellationToken)
Declaration
public virtual Task<int> SaveChangesOnDbContextAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default)
Parameters
| Type |
Name |
Description |
| bool |
acceptAllChangesOnSuccess |
|
| System.Threading.CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task<TResult><int> |
|
SetConcurrencyStampIfNull(EntityEntry)
Declaration
protected virtual void SetConcurrencyStampIfNull(EntityEntry entry)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry |
entry |
|
SetCreationAuditProperties(EntityEntry)
Declaration
protected virtual void SetCreationAuditProperties(EntityEntry entry)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry |
entry |
|
SetDeletionAuditProperties(EntityEntry)
Declaration
protected virtual void SetDeletionAuditProperties(EntityEntry entry)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry |
entry |
|
SetModificationAuditProperties(EntityEntry)
Declaration
protected virtual void SetModificationAuditProperties(EntityEntry entry)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry |
entry |
|
ShouldFilterEntity<TEntity>(IMutableEntityType)
Declaration
protected virtual bool ShouldFilterEntity<TEntity>(IMutableEntityType entityType) where TEntity : class
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.Metadata.IMutableEntityType |
entityType |
|
Returns
Type Parameters
TrySetDatabaseProvider(ModelBuilder)
Declaration
protected virtual void TrySetDatabaseProvider(ModelBuilder modelBuilder)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ModelBuilder |
modelBuilder |
|
TrySetGuidId(EntityEntry, IEntity<Guid>)
Declaration
protected virtual void TrySetGuidId(EntityEntry entry, IEntity<Guid> entity)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry |
entry |
|
| IEntity<System.Guid> |
entity |
|
UpdateConcurrencyStamp(EntityEntry)
Declaration
protected virtual void UpdateConcurrencyStamp(EntityEntry entry)
Parameters
| Type |
Name |
Description |
| Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry |
entry |
|
Implements
System.IDisposable
Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<>
Microsoft.EntityFrameworkCore.Internal.IDbContextDependencies
Microsoft.EntityFrameworkCore.Internal.IDbSetCache
Microsoft.EntityFrameworkCore.Internal.IDbContextPoolable
Microsoft.EntityFrameworkCore.Infrastructure.IResettableService
System.IAsyncDisposable
Extension Methods