2020-05-09 03:56:06 +00:00
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Wabbajack.BuildServer;
|
2020-11-02 00:30:49 +00:00
|
|
|
|
using Wabbajack.Server.DTOs;
|
2020-05-09 03:56:06 +00:00
|
|
|
|
|
|
|
|
|
namespace Wabbajack.Server.DataLayer
|
|
|
|
|
{
|
|
|
|
|
public partial class SqlService
|
|
|
|
|
{
|
|
|
|
|
private AppSettings _settings;
|
2020-11-02 00:30:49 +00:00
|
|
|
|
private Task<BunnyCdnFtpInfo> _mirrorCreds;
|
2020-05-09 03:56:06 +00:00
|
|
|
|
|
|
|
|
|
public SqlService(AppSettings settings)
|
|
|
|
|
{
|
|
|
|
|
_settings = settings;
|
2020-11-02 00:30:49 +00:00
|
|
|
|
_mirrorCreds = BunnyCdnFtpInfo.GetCreds(StorageSpace.Mirrors);
|
2020-05-09 03:56:06 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<SqlConnection> Open()
|
|
|
|
|
{
|
|
|
|
|
var conn = new SqlConnection(_settings.SqlConnection);
|
|
|
|
|
await conn.OpenAsync();
|
|
|
|
|
return conn;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|