Class ApplicationDbContext
Implements
Inherited Members
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 SourceApplicationDbContext(DbContextOptions<ApplicationDbContext>)
Declaration
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
Parameters
Type | Name | Description |
---|---|---|
DbContextOptions<ApplicationDbContext> | options |
Properties
| Edit this page View SourceCurrentTransaction
Получить текущую транзакцию
Declaration
public IDbContextTransaction? CurrentTransaction { get; }
Property Value
Type | Description |
---|---|
IDbContextTransaction |
NotificationLogs
История отправки
Declaration
public DbSet<NotificationLog> NotificationLogs { get; set; }
Property Value
Type | Description |
---|---|
DbSet<NotificationLog> |
Methods
| Edit this page View SourceBeginTransactionAsync(CancellationToken)
Начать транзакцию
Declaration
public Task<IDbContextTransaction> BeginTransactionAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IDbContextTransaction> |
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
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.