dotnet / dotnet/AspNetCore.Docs

New topic: Getting the DbContext outside of a Controller

Open
#4,782 5 comments 0 reactions 0 assignees View on GitHub
doc-enhancement re-Aditya
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 3h
Merged PRs (30d)
97

Description

- [ ] Getting the DbContext outside of a Controller
- [ ] Accessing scoped services outside of an HTTP request.

per @davidfowl
There's enough confusion here that I think we should have a first class topic for it on the EF docs:

https://www.reddit.com/r/dotnet/comments/7cednh/how_to_grab_a_dbcontext_from_outside_a_controller/
We should probably also have something on accessing scoped services outside of an http request.

Can one of @ajcvickers or @divega provide the sample for *Getting the DbContext outside of a Controller*?

@rynowak @danroth27 who's the contact for _Accessing scoped services outside of an HTTP request?_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.