What is the use of dependency injection in C# ?
Please don't provide any links.
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.
Shweta LodhaPosted Nov 23, 2021, 12:11 AM
It helps you to define your code in a more loosely coupled manner. So, rather than caller instantiating a new object (in C#, instantiation done using new keyword), someone else (DI container) does this for him and caller will just take a responsibility to make a call. Most common practise for achieving this is by using interfaces.
geetha geethaPosted Nov 22, 2021, 2:10 PM
Sreekanth ReddyPosted Nov 10, 2016, 4:24 AM
Pradeep Sahoo
Pradeep SahooPosted Nov 10, 2016, 4:20 AM