25 lines
840 B
C#
25 lines
840 B
C#
|
using System.Data;
|
||
|
using System.Data.Common;
|
||
|
|
||
|
namespace Galaeth.Core.Infrastructure;
|
||
|
|
||
|
/// <summary>
|
||
|
/// Database transaction provider.
|
||
|
/// </summary>
|
||
|
public interface ITransactionProvider
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// Begin a new transaction.
|
||
|
/// </summary>
|
||
|
/// <param name="isolationLevel">One of <see cref="IsolationLevel"/>.</param>
|
||
|
/// <returns>Instance of <see cref="IDbTransaction"/>.</returns>
|
||
|
IDbTransaction BeginTransaction(IsolationLevel isolationLevel = IsolationLevel.Unspecified);
|
||
|
|
||
|
/// <summary>
|
||
|
/// Begin a new transaction.
|
||
|
/// </summary>
|
||
|
/// <param name="isolationLevel">One of <see cref="IsolationLevel"/>.</param>
|
||
|
/// <returns>Instance of <see cref="IDbTransaction"/>.</returns>
|
||
|
Task<IDbTransaction> BeginTransactionAsync(IsolationLevel isolationLevel = IsolationLevel.Unspecified);
|
||
|
}
|