Add one to many relations
This commit is contained in:
parent
a9e52b199b
commit
8faebbd63c
@ -11,7 +11,7 @@ using MyDarling.Models;
|
||||
namespace MyDarling.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20230131125316_Init")]
|
||||
[Migration("20230201044832_Init")]
|
||||
partial class Init
|
||||
{
|
||||
/// <inheritdoc />
|
@ -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>();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user