Skip to content

Instantly share code, notes, and snippets.

View christianspeegle's full-sized avatar

Christian Speegle christianspeegle

View GitHub Profile
@christianspeegle
christianspeegle / ApplicationDbContext.cs
Created December 21, 2019 19:58
Extracting EFCore configuration into separate project
// DatabaseProject/ApplicationDbContext.cs
/*
This file actually allows you to inject a configured DbContext into each different project
Just add DatabaseProject with a using statement at the top of your Startup.cs files
You will still need to supply configuration options when you register the service
*/
using Microsoft.EntityFrameworkCore;
namespace DataAccess