Show / Hide Table of Contents

Class ApplicationDbContext

Inheritance
object
DbContext
ApplicationDbContext
Implements
IInfrastructure<IServiceProvider>
IDbContextDependencies
IDbSetCache
IDbContextPoolable
IResettableService
IDisposable
IAsyncDisposable
IDbContext
Inherited Members
DbContext.Set<TEntity>()
DbContext.Set<TEntity>(string)
DbContext.OnConfiguring(DbContextOptionsBuilder)
DbContext.ConfigureConventions(ModelConfigurationBuilder)
DbContext.SaveChanges()
DbContext.SaveChanges(bool)
DbContext.SaveChangesAsync(CancellationToken)
DbContext.SaveChangesAsync(bool, CancellationToken)
DbContext.Dispose()
DbContext.DisposeAsync()
DbContext.Entry<TEntity>(TEntity)
DbContext.Entry(object)
DbContext.Add<TEntity>(TEntity)
DbContext.AddAsync<TEntity>(TEntity, CancellationToken)
DbContext.Attach<TEntity>(TEntity)
DbContext.Update<TEntity>(TEntity)
DbContext.Remove<TEntity>(TEntity)
DbContext.Add(object)
DbContext.AddAsync(object, CancellationToken)
DbContext.Attach(object)
DbContext.Update(object)
DbContext.Remove(object)
DbContext.AddRange(params object[])
DbContext.AddRangeAsync(params object[])
DbContext.AttachRange(params object[])
DbContext.UpdateRange(params object[])
DbContext.RemoveRange(params object[])
DbContext.AddRange(IEnumerable<object>)
DbContext.AddRangeAsync(IEnumerable<object>, CancellationToken)
DbContext.AttachRange(IEnumerable<object>)
DbContext.UpdateRange(IEnumerable<object>)
DbContext.RemoveRange(IEnumerable<object>)
DbContext.Find(Type, params object[])
DbContext.FindAsync(Type, params object[])
DbContext.FindAsync(Type, object[], CancellationToken)
DbContext.Find<TEntity>(params object[])
DbContext.FindAsync<TEntity>(params object[])
DbContext.FindAsync<TEntity>(object[], CancellationToken)
DbContext.FromExpression<TResult>(Expression<Func<IQueryable<TResult>>>)
DbContext.Database
DbContext.ChangeTracker
DbContext.Model
DbContext.ContextId
DbContext.SavingChanges
DbContext.SavedChanges
DbContext.SaveChangesFailed
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NotifyHub.NotificationService.Persistence.Contexts
Assembly: NotifyHub.NotificationService.Persistence.dll
Syntax
public class ApplicationDbContext : DbContext, IInfrastructure<IServiceProvider>, IDbContextDependencies, IDbSetCache, IDbContextPoolable, IResettableService, IDisposable, IAsyncDisposable, IDbContext

Constructors

| Edit this page View Source

ApplicationDbContext(DbContextOptions<ApplicationDbContext>)

Declaration
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
Parameters
Type Name Description
DbContextOptions<ApplicationDbContext> options

Properties

| Edit this page View Source

CurrentTransaction

Получить текущую транзакцию

Declaration
public IDbContextTransaction? CurrentTransaction { get; }
Property Value
Type Description
IDbContextTransaction
| Edit this page View Source

NotificationLogs

История отправки

Declaration
public DbSet<NotificationLog> NotificationLogs { get; set; }
Property Value
Type Description
DbSet<NotificationLog>

Methods

| Edit this page View Source

BeginTransactionAsync(CancellationToken)

Начать транзакцию

Declaration
public Task<IDbContextTransaction> BeginTransactionAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<IDbContextTransaction>
| Edit this page View Source

OnModelCreating(ModelBuilder)

Override this method to further configure the model that was discovered by convention from the entity types exposed in DbSet<TEntity> properties on your derived context. The resulting model may be cached and re-used for subsequent instances of your derived context.

Declaration
protected override void OnModelCreating(ModelBuilder modelBuilder)
Parameters
Type Name Description
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
DbContext.OnModelCreating(ModelBuilder)
Remarks

If a model is explicitly set on the options for this context (via UseModel(IModel)) then this method will not be run. However, it will still run when creating a compiled model.

See Modeling entity types and relationships for more information and examples.

Implements

IInfrastructure<T>
IDbContextDependencies
IDbSetCache
IDbContextPoolable
IResettableService
IDisposable
IAsyncDisposable
IDbContext
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX