LyraLearn AI Learning Platform
Exams
← Back to the lesson
Module 3 Β· Quiz

DI Lifetime Scenarios

1. What is the primary reason for the issue of ObjectDisposedException in a singleton holding a DbContext?
2. Which of the following correctly describes a scoped service?
3. How can you correctly resolve a DbContext in a singleton service to avoid captive dependencies?
4. Which scenario illustrates the concept of a captive dependency in Dependency Injection?