From 1a96616699ab41bf6343bc1acc45a836c3e6caf3 Mon Sep 17 00:00:00 2001 From: Paweł Bernaciak Date: Fri, 22 Dec 2023 16:02:41 +0100 Subject: Backup --- CoreWiki/Models/ApplicationDbContext.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'CoreWiki/Models/ApplicationDbContext.cs') diff --git a/CoreWiki/Models/ApplicationDbContext.cs b/CoreWiki/Models/ApplicationDbContext.cs index 48b5dcf..38c3787 100644 --- a/CoreWiki/Models/ApplicationDbContext.cs +++ b/CoreWiki/Models/ApplicationDbContext.cs @@ -1,4 +1,5 @@ using Microsoft.EntityFrameworkCore; +using NodaTime; namespace CoreWiki.Models; @@ -8,7 +9,13 @@ public class ApplicationDbContext : DbContext public ApplicationDbContext(DbContextOptions options) : base(options) { - } + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + modelBuilder.Entity
().HasData( + new Article { Topic = "Home Page", Slug = "home-page", Content = "Welcome to your new CoreWiki installation" } + ); + } } \ No newline at end of file -- cgit v1.2.3