Skip to content

Commit

Permalink
feat: properties added to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoBaSs84 committed Jul 25, 2024
1 parent 038fad2 commit a5f04ca
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#pragma warning disable CA1716 // Identifiers should not match keywords
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;

namespace BB84.EntityFrameworkCore.Repositories.Abstractions;

Expand All @@ -9,17 +12,29 @@ namespace BB84.EntityFrameworkCore.Repositories.Abstractions;
/// <remarks>
/// Every custom database context should inherit from this interface.
/// </remarks>
public interface IDbContext : IDisposable
public interface IDbContext : IAsyncDisposable, IDisposable
{
/// <inheritdoc cref="DbContext.SavingChanges"/>
event EventHandler<SavingChangesEventArgs>? SavingChanges;

/// <inheritdoc cref="DbContext.SavedChanges"/>
event EventHandler<SavedChangesEventArgs>? SavedChanges;

/// <inheritdoc cref="DbContext.SaveChangesFailed"/>
event EventHandler<SaveChangesFailedEventArgs>? SaveChangesFailed;

/// <inheritdoc cref="DbContext.ChangeTracker"/>
ChangeTracker ChangeTracker { get; }

/// <inheritdoc cref="DbContext.ContextId"/>
DbContextId ContextId { get; }

/// <inheritdoc cref="DbContext.Database"/>
DatabaseFacade Database { get; }

/// <inheritdoc cref="DbContext.Model"/>
IModel Model { get; }

/// <inheritdoc cref="DbContext.Set{TEntity}()"/>
DbSet<TEntity> Set<TEntity>() where TEntity : class;

Expand Down

0 comments on commit a5f04ca

Please sign in to comment.