Why Each Request Gets Its Own DbContext in ASP.NET Core
In ASP.NET Core you ask for a DbContext, and one appears. Which one? Each HTTP request gets its own, shared by everything in that request, and it's disposed of when the request ends. This guide proves that with real IDs, and explains what the rule means for code that lives outside a request.
