Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Using Service Context from AddDbContext

$
0
0

I have a DbContext added as a service in startup.cs using AddDbContext.

services.AddDbContext<PartyDbContext>(options =>
	options.UseSqlServer(Configuration.GetConnectionString("PartyConnection")));

How do I reference/use this context from inside a class?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>