← Back
Milan Jovanovic January 3, 2026 38s

EF Core Pro Tip: Using DbContextFactory

Summary

The transcript discusses using a database context factory in .NET as a method for managing database connections and contexts on demand, specifically highlighting the process of registering a context factory with a provider like PostgreSQL. The key technical elements involve injecting the IDB context factory interface and utilizing its create method to generate new database context instances dynamically. The practical takeaway is understanding how to create and manage database contexts efficiently, while being mindful of resource management and the scope of context instances.

View original episode ↗