-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the overloading mechanism instead of the optional parameters
- Loading branch information
1 parent
372b882
commit 9203c69
Showing
2 changed files
with
12 additions
and
5 deletions.
There are no files selected for viewing
12 changes: 8 additions & 4 deletions
12
src/SwiftLink.Application/Common/Interfaces/IApplicationDbContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
using SwiftLink.Domain.Common; | ||
|
||
namespace SwiftLink.Application.Common.Interfaces; | ||
namespace SwiftLink.Application.Common.Interfaces; | ||
|
||
/// <summary> | ||
/// This interface facilitates communication between the application layer, infrastructure, and the DbContext. | ||
/// </summary> | ||
public interface IApplicationDbContext | ||
{ | ||
/// <summary> | ||
/// Save all entities in to database. | ||
/// </summary> | ||
/// <returns></returns> | ||
public Task<Result> SaveChangesAsync(); | ||
|
||
/// <summary> | ||
/// Save all entities in to database. | ||
/// </summary> | ||
/// <param name="cancellationToken"></param> | ||
/// <returns></returns> | ||
public Task<Result> SaveChangesAsync(CancellationToken cancellationToken = default); | ||
public Task<Result> SaveChangesAsync(CancellationToken cancellationToken); | ||
|
||
DbSet<TEntity> Set<TEntity>() where TEntity : class; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters