How a class dependent to another class? Any example so that clearly explain in interview.
Now what is Dependency injection? they reduces tightly coupled to loosley coupled so, code maintaince is easy so how any example?
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.
Vinay SinghPosted Aug 1, 2016, 5:31 AM
Sandeep Singh ShekhawatPosted Aug 1, 2016, 2:23 AM
Ashish VermaPosted Aug 1, 2016, 2:05 AM
Manas MohapatraPosted Aug 1, 2016, 1:59 AM
Sandeep Singh ShekhawatPosted Aug 1, 2016, 1:39 AM
There are three types of dependency injections:
- Constructor Dependency Injection
- Setter Dependency Injection
- Interface Dependency Injection
There are some articles which explained dependencyinjection and Inversion of control. Please have a look on below.1.http://www.c-sharpcorner.com/UploadFile/3d39b4/constructor-dependency-injection-pattern-implementation-in-c/
2. http://www.c-sharpcorner.com/UploadFile/3d39b4/crud-operations-using-the-generic-repository-pattern-and-dep/
3.http://www.c-sharpcorner.com/article/dependency-inject-using-ninject-ioc-in-console-application/