Skip to content

Instantly share code, notes, and snippets.

@changhuixu
Created July 11, 2018 18:26
Show Gist options
  • Save changhuixu/d6fc586e228b36847ff64274e7ba1595 to your computer and use it in GitHub Desktop.
Save changhuixu/d6fc586e228b36847ff64274e7ba1595 to your computer and use it in GitHub Desktop.
WebBlogsDbContext.cs
public class WebBlogsDbContext : Microsoft.EntityFrameworkCore.DbContext
{
public virtual DbSet<Author> Authors { get; protected set; }
public WebBlogsDbContext(DbContextOptions options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfiguration(new AuthorEntityTypeConfiguration());
modelBuilder.ApplyConfiguration(new BlogEntityTypeConfiguration());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment