Please follow this article: https://www.c-sharpcorner.com/UploadFile/85ed7a/dependency-injection-in-C-Sharp/
Dependency injection is a software design pattern that implements inversion of control for resolving dependencies. A dependency is an object that can be used (a service). An injection is the passing of a dependency to a dependent object (a client) that would use it.