25 lines
755 B
C#
25 lines
755 B
C#
// <copyright file="IDbConnectionProvider.cs" company="alveus.dev">
|
|
// Copyright (c) alveus.dev. All rights reserved. Licensed under the MIT License.
|
|
// </copyright>
|
|
|
|
using System.Data;
|
|
|
|
namespace Astral.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();
|
|
}
|