galaeth-draft/Galaeth.Core/Infrastructure/IDbConnectionProvider.cs
2024-11-17 09:31:01 +00:00

22 lines
587 B
C#

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();
}