mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-19 02:51:50 +00:00
21 lines
530 B
C#
21 lines
530 B
C#
using Microsoft.Extensions.Logging;
|
|
|
|
namespace WeaponPaints
|
|
{
|
|
public class Database
|
|
{
|
|
private readonly Func<IDatabaseConnection> _connectionFactory;
|
|
|
|
public Database(Func<IDatabaseConnection> connectionFactory)
|
|
{
|
|
_connectionFactory = connectionFactory;
|
|
}
|
|
|
|
public async Task<IDatabaseConnection> GetConnectionAsync()
|
|
{
|
|
var connection = _connectionFactory();
|
|
await connection.OpenAsync();
|
|
return connection;
|
|
}
|
|
}
|
|
} |