blob: 38c3787d6165947a3254825fffac2d4c7ed1076c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
using Microsoft.EntityFrameworkCore;
using NodaTime;
namespace CoreWiki.Models;
public class ApplicationDbContext : DbContext
{
public DbSet<Article> Articles { get; set; }
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Article>().HasData(
new Article { Topic = "Home Page", Slug = "home-page", Content = "Welcome to your new CoreWiki installation" }
);
}
}
|