diff options
Diffstat (limited to 'backend/Elements.Data/ApplicationContextFactory.cs')
| -rw-r--r-- | backend/Elements.Data/ApplicationContextFactory.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/backend/Elements.Data/ApplicationContextFactory.cs b/backend/Elements.Data/ApplicationContextFactory.cs new file mode 100644 index 0000000..b8e4ebd --- /dev/null +++ b/backend/Elements.Data/ApplicationContextFactory.cs @@ -0,0 +1,15 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; + +namespace Elements.Data; + +public class ApplicationContextFactory : IDesignTimeDbContextFactory<ApplicationDbContext> +{ + public ApplicationDbContext CreateDbContext(string[] args) + { + DbContextOptionsBuilder<ApplicationDbContext> optionsBuilder = new(); + optionsBuilder.UseSqlite("Data Source=elements.db"); + + return new ApplicationDbContext(optionsBuilder.Options); + } +}
\ No newline at end of file |
