From 8faebbd63cf19fd21947c1f98ac80cc2e714c5ba Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Wed, 1 Feb 2023 07:49:31 +0300 Subject: Add one to many relations --- Models/DataContext.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Models') 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().HasMany(b => b.Figures).WithOne(); + } + public DbSet UnderwearBundles => Set(); public DbSet
Figures => Set
(); } -- cgit v1.2.3