Skip to content

Instantly share code, notes, and snippets.

@ducmeit1
Created July 10, 2019 07:06
Show Gist options
  • Save ducmeit1/5f29761779516991f5c0e4b65d5f7f7b to your computer and use it in GitHub Desktop.
Save ducmeit1/5f29761779516991f5c0e4b65d5f7f7b to your computer and use it in GitHub Desktop.
using Microsoft.EntityFrameworkCore;
namespace Demo {
public class MyDbContext : DbContext
{
public MyDbContext(DbContextOptions<MyDbContext> options) : base(options) {}
protected override void OnModelCreating(ModelBuilder modelBuilder){
modelBuilder.ApplyConfiguration(new UserConfiguration());
//In here, you will have to do loop again for every new entity configuration, it will make you feel lazy if you are :D
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment