summaryrefslogtreecommitdiff
path: root/Models
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2023-02-01 07:49:31 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2023-02-01 07:49:31 +0300
commit8faebbd63cf19fd21947c1f98ac80cc2e714c5ba (patch)
treef7dab707399541b5cdf0eca194667d9a514ea9d1 /Models
parenta9e52b199b0661b85ca0c7e1318c30742a1168bd (diff)
Add one to many relations
Diffstat (limited to 'Models')
-rw-r--r--Models/DataContext.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Models/DataContext.cs b/Models/DataContext.cs
index 50adf12..c874420 100644
--- a/Models/DataContext.cs
+++ b/Models/DataContext.cs
@@ -15,6 +15,11 @@ namespace MyDarling.Models
opts.UseSqlite(configuration.GetConnectionString("MyDarlingDb"));
}
+ protected override void OnModelCreating(ModelBuilder builder)
+ {
+ builder.Entity<UnderwearBundle>().HasMany(b => b.Figures).WithOne();
+ }
+
public DbSet<UnderwearBundle> UnderwearBundles => Set<UnderwearBundle>();
public DbSet<Figure> Figures => Set<Figure>();
}