© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
3 replies
Spaxter

✅ Transient DbContext vs DbContextFactory

In EF Core, what is the difference between registering a transient
DbContext
DbContext
vs a
DbContextFactory
DbContextFactory
for DI?

In both cases the DbContext will be created on-demand and disposed when the operation is completed, right? Are there any clear indications on when to use which?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

❔ DbContext
C#CC# / help
4y ago
.NET Core DBContext
C#CC# / help
2w ago
Dbcontext and SaveChanges()
C#CC# / help
5mo ago
✅ DbContext lock up application
C#CC# / help
3mo ago