-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial work on async connections
- Loading branch information
Showing
7 changed files
with
326 additions
and
39 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System.Data; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace NPoco | ||
{ | ||
public interface IAsyncBaseDatabase : IBaseDatabase | ||
{ | ||
/// <summary> | ||
/// Opens the DbConnection manually | ||
/// </summary> | ||
Task<IAsyncDatabase> OpenSharedConnectionAsync(CancellationToken cancellationToken = default); | ||
|
||
/// <summary> | ||
/// Closes the DBConnection manually | ||
/// </summary> | ||
Task CloseSharedConnectionAsync(); | ||
|
||
#if NETSTANDARD2_1_OR_GREATER | ||
/// <summary> | ||
/// Manually begin a transaction. Recommended to use GetTransaction | ||
/// </summary> | ||
Task BeginTransactionAsync(); | ||
|
||
/// <summary> | ||
/// Manually begin a transaction. Recommended to use GetTransaction | ||
/// </summary> | ||
Task BeginTransactionAsync(IsolationLevel isolationLevel); | ||
|
||
/// <summary> | ||
/// Manually abort/rollback a transaction | ||
/// </summary> | ||
Task AbortTransactionAsync(); | ||
|
||
/// <summary> | ||
/// Manually commit a transaction | ||
/// </summary> | ||
Task CompleteTransactionAsync(); | ||
#endif | ||
} | ||
} |
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
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.