mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-11-01 00:12:30 +01:00
28 lines
647 B
C#
28 lines
647 B
C#
using System.Data.Common;
|
|
using System.Data.SqlServerCe;
|
|
using System.IO;
|
|
|
|
namespace NzbDrone.SqlCe
|
|
{
|
|
public class SqlCeProxy
|
|
{
|
|
public SqlCeConnection EnsureDatabase(string connectionString)
|
|
{
|
|
var connection = new SqlCeConnection(connectionString);
|
|
|
|
if (!File.Exists(connection.Database))
|
|
{
|
|
var engine = new SqlCeEngine(connectionString);
|
|
engine.CreateDatabase();
|
|
}
|
|
|
|
return connection;
|
|
}
|
|
|
|
public DbProviderFactory GetSqlCeProviderFactory()
|
|
{
|
|
return new SqlCeProviderFactory();
|
|
}
|
|
}
|
|
}
|