galaeth-draft/Galaeth.Core/Infrastructure/IDbConnectionProvider.cs

22 lines
587 B
C#
Raw Permalink Normal View History

2024-11-17 10:31:01 +01:00
using System.Data;
namespace Galaeth.Core.Infrastructure;
/// <summary>
/// Scoped database connection provider.
/// </summary>
public interface IDbConnectionProvider : IDisposable
{
/// <summary>
/// Open new database connection for this scope.
/// </summary>
/// <returns>Instance of <see cref="IDbConnection"/>.</returns>
IDbConnection OpenConnection();
/// <summary>
/// Open new database connection for this scope.
/// </summary>
/// <returns>Instance of <see cref="IDbConnection"/>.</returns>
Task<IDbConnection> OpenConnectionAsync();
}