elsa-core/src/samples/Sample14/ElsaContextFactory.cs
Sipke Schoorstra f44d7e12b9
Wrapping AutoMapper (#309)
* Wrapping AutoMapper
2020-05-15 12:08:02 +02:00

20 lines
692 B
C#

using Elsa.Persistence.EntityFrameworkCore.DbContexts;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
namespace Sample14
{
public class ElsaContextFactory : IDesignTimeDbContextFactory<ElsaContext>
{
public ElsaContext CreateDbContext(string[] args)
{
var optionsBuilder = new DbContextOptionsBuilder<ElsaContext>();
optionsBuilder.UseSqlite(
@"Data Source=c:\data\elsa.entity-framework-core.db;Cache=Shared",
x => x.MigrationsAssembly(typeof(Program).Assembly.FullName));
return new ElsaContext(optionsBuilder.Options);
}
}
}