15Dependency Injection and Configuration
WHAT IS DEPENDENCY INJECTION?
Faster development cycles demand unit tests and better updatability. Making some code changes should not result in errors where you don't expect them. Creating more modular applications where dependencies are reduced helps with that.
Dependency injection (DI) is a pattern where an object receives other objects it depends on—instead of creating it on its own. This reduces dependencies, because the receiving object doesn't need to know about the details of the object it receives; all it needs is a contract (usually a C# interface).
Dependency injection ...
Get Professional C# and .NET, 2021st Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.