Lyra
Learn
AI Learning Platform
π Midnight
π Comfort
π₯ Ember
π Paper
β Contrast
Exams
Sign in to track progress
β Back to the lesson
Module 6 Β· Quiz
Services and Interfaces
1. What is the primary purpose of defining interfaces for services in the service layer?
To improve performance
To enable replaceability and testability
To create deep inheritance hierarchies
To make services easier to register
2. Which lifetime should be used for HttpContext in ASP.NET Core DI?
Transient
Singleton
Scoped
Transient and Scoped
3. What does a service locator pattern do that is discouraged in dependency injection?
Increases testability
Hides dependencies
Enhances performance
Simplifies code
4. What is a common mistake when configuring singleton services in relation to scoped dependencies?
Using transient dependencies
Mixing different dependency lifetimes
Not using interfaces
Registering services without lifetimes
Submit answers
Continue: AutoMapper Without Tears β
Review this lesson
Retake quiz