This commit is contained in:
NicolasDorier
2017-09-13 15:47:34 +09:00
commit b5c6ed3860
228 changed files with 63977 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace BTCPayServer.Data
{
public class ApplicationDbContextFactory
{
string _Path;
public ApplicationDbContextFactory(string path)
{
_Path = path ?? throw new ArgumentNullException(nameof(path));
}
public ApplicationDbContext CreateContext()
{
var builder = new DbContextOptionsBuilder<ApplicationDbContext>();
builder.UseSqlite("Data Source=" + _Path);
return new ApplicationDbContext(builder.Options);
}
}
}