Dependency injection is a design pattern to achieve Inversion of Control(IoC) where an object supplies dependencies for another object by making use of interfaces. This makes the application loosely coupled and enables easier maintenance.
- Install dotnet. Verify the installation by opening the command line and typing
dotnet --version
. Executing this command must output a version of dotnet. - In the command line, go to the location of this project. E.g. in Linux if this project is in the home directory, type
cd $HOME/DependencyInjectionExample
and press Enter key. - Execute the command -
dotnet run
to execute the program and view the output in console.