Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Aug 2, 2022, 10:51 AM EDT
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Aug 2, 2022, 8:28 AM EDT
Vishal YelveRank #178 · 13.6K reputationPosted Aug 2, 2022, 8:32 AM EDT
Vishal JoshiRank #377 · 6.7K reputationPosted Aug 2, 2022, 8:43 AM EDT
Amit MohantyRank #112 · 20K reputationPosted Aug 3, 2022, 12:40 AM EDT
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 ShuklaRank #552 · 4.4K reputationPosted Aug 3, 2022, 12:22 AM EDT
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/