Created
July 11, 2018 18:26
-
-
Save changhuixu/d6fc586e228b36847ff64274e7ba1595 to your computer and use it in GitHub Desktop.
WebBlogsDbContext.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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