1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-26 17:59:14 +00:00
Radarr/NzbDrone.Services/NzbDrone.Services.Service/Datastore/Connection.cs

29 lines
No EOL
702 B
C#

using System.Configuration;
using System.Linq;
using NzbDrone.Services.Service.Migrations;
using PetaPoco;
namespace NzbDrone.Services.Service.Datastore
{
public static class Connection
{
public static string GetConnectionString
{
get { return ConfigurationManager.ConnectionStrings["SqlExpress"].ConnectionString; }
}
public static IDatabase GetPetaPocoDb()
{
MigrationsHelper.Run(GetConnectionString);
var db = new Database("SqlExpress")
{
KeepConnectionAlive = true,
ForceDateTimesToUtc = false,
};
return db;
}
}
}