Add context factory.

This commit is contained in:
2019-01-02 23:00:00 +00:00
parent 597f27a3ae
commit 38544897e5
3 changed files with 11 additions and 0 deletions

View File

@@ -296,6 +296,7 @@
</e>
<e p="DiscImageChef.Database" t="IncludeRecursive">
<e p="Context.cs" t="Include" />
<e p="ContextFactory.cs" t="Include" />
<e p="DiscImageChef.Database.csproj" t="IncludeRecursive" />
<e p="Migrations" t="Include">
<e p="20181126222301_DeviceReportV2.Designer.cs" t="Include" />

View File

@@ -0,0 +1,9 @@
using Microsoft.EntityFrameworkCore.Design;
namespace DiscImageChef.Database
{
public class DicContextFactory : IDesignTimeDbContextFactory<DicContext>
{
public DicContext CreateDbContext(string[] args) => DicContext.Create("discimagechef.db");
}
}

View File

@@ -58,6 +58,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Context.cs" />
<Compile Include="ContextFactory.cs" />
<Compile Include="Migrations\20181126222301_DeviceReportV2.cs" />
<Compile Include="Migrations\20181126222301_DeviceReportV2.Designer.cs" />
<Compile Include="Migrations\20181127001622_AddDeviceBasicFields.cs" />