You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
701 B
30 lines
701 B
using System.Configuration;
|
|
using System.Linq;
|
|
using NzbDrone.Services.Service.Migrations;
|
|
using Services.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 = false,
|
|
ForceDateTimesToUtc = false,
|
|
};
|
|
|
|
return db;
|
|
}
|
|
}
|
|
} |