Dependency Injection in ASP.NET Core

If your classes require other classes to perform their operations, these other classes are dependencies.

Dependency injection (DI) is a technique for achieving loose coupling between objects and their dependencies.

Rather than directly instantiating the dependent object or static referencing the object, we inject the dependent object in some other fashion.

Most often, classes will declare their dependencies via their constructor, allowing them to follow the Explicit Dependencies Principle. This approach is known as "constructor injection".

results matching ""

    No results matching ""