summaryrefslogtreecommitdiff
path: root/Models/DataContext.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Models/DataContext.cs')
-rw-r--r--Models/DataContext.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Models/DataContext.cs b/Models/DataContext.cs
new file mode 100644
index 0000000..50adf12
--- /dev/null
+++ b/Models/DataContext.cs
@@ -0,0 +1,21 @@
+using Microsoft.EntityFrameworkCore;
+
+namespace MyDarling.Models
+{
+ public class DataContext : DbContext
+ {
+ protected readonly IConfiguration configuration;
+ public DataContext(IConfiguration configuration)
+ {
+ this.configuration = configuration;
+ }
+
+ protected override void OnConfiguring(DbContextOptionsBuilder opts)
+ {
+ opts.UseSqlite(configuration.GetConnectionString("MyDarlingDb"));
+ }
+
+ public DbSet<UnderwearBundle> UnderwearBundles => Set<UnderwearBundle>();
+ public DbSet<Figure> Figures => Set<Figure>();
+ }
+} \ No newline at end of file