Initial commit

This commit is contained in:
2023-01-30 09:20:18 +01:00
commit 1b43dd3109
17 changed files with 662 additions and 0 deletions

32
Data/ThuisDbContext.cs Normal file
View File

@@ -0,0 +1,32 @@
using Microsoft.EntityFrameworkCore;
using ThuisApi.Models;
namespace ThuisApi.Data;
public class ThuisDbContext : DbContext
{
public DbSet<Card> Cards { get; set; }
public DbSet<Freezer> Freezer { get; set; }
public DbSet<FreezerItem> FreezerItem { get; set; }
public ThuisDbContext(DbContextOptions<ThuisDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Freezer>().HasData(
new Freezer
{
FreezerId = 1,
Name = "Keuken"
},
new Freezer
{
FreezerId = 2,
Name = "Berging"
});
}
}