What is dependency injection in .NET
Loading
What is dependency injection in .NET
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sachin SinghPosted Aug 2, 2022, 2:51 PM
Amit MohantyPosted Aug 3, 2022, 4:40 AM
There are three types of Dependency injection:
1- Constructor Injection
2- Property Injection
3- Method Injection
Dependency injection has the following benefits:
1- Enables clean code
2- Enables unit testing
3- Encourages decoupling
4- Improves code maintainability
5- Centralizes code configuration
Pushpendra ShuklaPosted Aug 3, 2022, 4:22 AM
The term dependency means to depend on anyone else which means if an object is dependent on other objects that are called a dependency. Dependency is a relationship between a component or class that can be thought of as a uses relationship generally the parameterized constructor that provides an object for a needed class. If you have more than one class that class is dependent on each other that is dependency. The dependency is injected into a parameterized constructor.
Read the complete article in dependency injection.
https://www.c-sharpcorner.com/article/complete-signup-login-system-using-dependency/
Vishal JoshiPosted Aug 2, 2022, 12:43 PM
Vishal YelvePosted Aug 2, 2022, 12:32 PM
Rajanikant HawaldarPosted Aug 2, 2022, 12:28 PM