Created
July 10, 2019 07:06
-
-
Save ducmeit1/5f29761779516991f5c0e4b65d5f7f7b to your computer and use it in GitHub Desktop.
This file contains 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
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