Injecting Dependencies into Controllers
ardalis opened this issue · comments
Steve Smith commented
ASPNET > Getting Started
- Show how Controllers can follow Explicit Dependencies Principle and request their dependencies via their constructor.
- Show how to configure services in ConfigureServices (going beyond what's in lesson 8).
- Demonstrate how to use a configured service to perform some work for a view-based controller and for an API method.
- Note that dependencies should be small and focused on only UI concerns. Business logic should go into other classes and should be injected. This makes both controllers and business classes easier to test (see next lesson).
James Chambers commented
Closed by #164