Class AbpDbContext<TDbContext>
Inheritance
System.Object
AbpDbContext<TDbContext>
Implements
IDisposable
IInfrastructure<IServiceProvider>
IDbContextDependencies
IDbSetCache
IDbContextPoolable
ITransientDependency
Assembly: Volo.Abp.EntityFrameworkCore.dll
Syntax
public abstract class AbpDbContext<TDbContext> : DbContext, IAbpEfCoreDbContext, IEfCoreDbContext, IDisposable, IInfrastructure<IServiceProvider>, IDbContextDependencies, IDbSetCache, IDbContextPoolable, 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 |
|
Properties
AuditingManager
Declaration
public IAuditingManager AuditingManager { get; set; }
Property Value
Type |
Description |
IAuditingManager |
|
AuditPropertySetter
Declaration
public IAuditPropertySetter AuditPropertySetter { get; set; }
Property Value
Type |
Description |
IAuditPropertySetter |
|
Clock
Declaration
public IClock Clock { get; set; }
Property Value
CurrentTenant
Declaration
public ICurrentTenant CurrentTenant { get; set; }
Property Value
Type |
Description |
ICurrentTenant |
|
CurrentTenantId
Declaration
protected virtual Guid? CurrentTenantId { get; }
Property Value
Type |
Description |
System.Nullable<Guid> |
|
DataFilter
Declaration
public IDataFilter DataFilter { get; set; }
Property Value
Type |
Description |
IDataFilter |
|
EntityChangeEventHelper
Declaration
public IEntityChangeEventHelper EntityChangeEventHelper { get; set; }
Property Value
EntityHistoryHelper
Declaration
public IEntityHistoryHelper EntityHistoryHelper { get; set; }
Property Value
GuidGenerator
Declaration
public IGuidGenerator GuidGenerator { get; set; }
Property Value
Type |
Description |
IGuidGenerator |
|
IsMultiTenantFilterEnabled
Declaration
protected virtual bool IsMultiTenantFilterEnabled { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsSoftDeleteFilterEnabled
Declaration
protected virtual bool IsSoftDeleteFilterEnabled { get; }
Property Value
Type |
Description |
System.Boolean |
|
Logger
Declaration
public ILogger<AbpDbContext<TDbContext>> Logger { get; set; }
Property Value
UnitOfWorkManager
Declaration
public IUnitOfWorkManager UnitOfWorkManager { get; set; }
Property Value
Type |
Description |
IUnitOfWorkManager |
|
Methods
AddDomainEvents(EntityChangeReport, Object)
Declaration
protected virtual void AddDomainEvents(EntityChangeReport changeReport, object entityAsObj)
Parameters
ApplyAbpConcepts()
Declaration
protected virtual EntityChangeReport ApplyAbpConcepts()
Returns
ApplyAbpConcepts(EntityEntry, EntityChangeReport)
Declaration
protected virtual void ApplyAbpConcepts(EntityEntry entry, EntityChangeReport changeReport)
Parameters
ApplyAbpConceptsForAddedEntity(EntityEntry, EntityChangeReport)
Declaration
protected virtual void ApplyAbpConceptsForAddedEntity(EntityEntry entry, EntityChangeReport changeReport)
Parameters
ApplyAbpConceptsForDeletedEntity(EntityEntry, EntityChangeReport)
Declaration
protected virtual void ApplyAbpConceptsForDeletedEntity(EntityEntry entry, EntityChangeReport changeReport)
Parameters
ApplyAbpConceptsForModifiedEntity(EntityEntry, EntityChangeReport)
Declaration
protected virtual void ApplyAbpConceptsForModifiedEntity(EntityEntry entry, EntityChangeReport changeReport)
Parameters
ChangeTracker_Tracked(Object, EntityTrackedEventArgs)
Declaration
protected virtual void ChangeTracker_Tracked(object sender, EntityTrackedEventArgs e)
Parameters
Type |
Name |
Description |
System.Object |
sender |
|
EntityTrackedEventArgs |
e |
|
CheckAndSetId(EntityEntry)
Declaration
protected virtual void CheckAndSetId(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
CombineExpressions<T>(Expression<Func<T, Boolean>>, Expression<Func<T, Boolean>>)
Declaration
protected virtual Expression<Func<T, bool>> CombineExpressions<T>(Expression<Func<T, bool>> expression1, Expression<Func<T, bool>> expression2)
Parameters
Type |
Name |
Description |
Expression<Func<T, System.Boolean>> |
expression1 |
|
Expression<Func<T, System.Boolean>> |
expression2 |
|
Returns
Type |
Description |
Expression<Func<T, System.Boolean>> |
|
Type Parameters
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
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
CreateFilterExpression<TEntity>()
Declaration
protected virtual Expression<Func<TEntity, bool>> CreateFilterExpression<TEntity>()
where TEntity : class
Returns
Type |
Description |
Expression<Func<TEntity, System.Boolean>> |
|
Type Parameters
Declaration
protected virtual void FillExtraPropertiesForTrackedEntities(EntityTrackedEventArgs e)
Parameters
Type |
Name |
Description |
EntityTrackedEventArgs |
e |
|
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 |
|
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
Type |
Description |
System.Boolean |
|
OnModelCreating(ModelBuilder)
Declaration
protected override void OnModelCreating(ModelBuilder modelBuilder)
Parameters
Type |
Name |
Description |
ModelBuilder |
modelBuilder |
|
SaveChangesAsync(Boolean, CancellationToken)
Declaration
public override Task<int> SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
System.Boolean |
acceptAllChangesOnSuccess |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<System.Int32> |
|
SaveChangesOnDbContextAsync(Boolean, CancellationToken)
Declaration
public virtual Task<int> SaveChangesOnDbContextAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = null)
Parameters
Type |
Name |
Description |
System.Boolean |
acceptAllChangesOnSuccess |
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<System.Int32> |
|
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 |
Description |
System.Boolean |
|
Type Parameters
TryCancelDeletionForSoftDelete(EntityEntry)
Declaration
protected virtual bool TryCancelDeletionForSoftDelete(EntityEntry entry)
Parameters
Type |
Name |
Description |
EntityEntry |
entry |
|
Returns
Type |
Description |
System.Boolean |
|
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 |
|
Implements
IDisposable
IInfrastructure<>
IDbContextDependencies
IDbSetCache
IDbContextPoolable
ITransientDependency
Extension Methods