.NET & C# · Entity Framework Core
How should DbContext and DbSet be designed for production in Entity Framework Core?
Use a short-lived scoped DbContext in web applications, async database calls, and never share a context across threads.