summaryrefslogtreecommitdiff
path: root/backend/Elements.Data/ApplicationContextFactory.cs
diff options
context:
space:
mode:
authorPaweł Bernaciak <pawelbernaciak@zohomail.eu>2023-10-21 11:55:33 +0200
committerPaweł Bernaciak <pawelbernaciak@zohomail.eu>2023-10-21 11:55:33 +0200
commit12fef7cbaf2073f9cc349ed765ea140be0259d8e (patch)
tree83412d050139bcdbd11eedffa61e1d0c9862dbed /backend/Elements.Data/ApplicationContextFactory.cs
parent17785848eb53f8d0420f6b6b3be00a0d10be4e1e (diff)
Basic API auth and Google login
Diffstat (limited to 'backend/Elements.Data/ApplicationContextFactory.cs')
-rw-r--r--backend/Elements.Data/ApplicationContextFactory.cs15
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