Last post May 24, 2018 10:30 AM by PatriceSc
May 24, 2018 04:30 AM|siddangoud|LINK
i am confusing in Dependency injection and IOC
Please explain me with example
thanks and regards
May 24, 2018 04:46 AM|KathyW|LINK
Since those questions can be answered by a simple google search, it would be far better to explain what you have already read and what you don't understand about them.
Google "C# dependency injection example" and "c# ioc container example" and you'll get examples, including examples of both in the same article.
May 24, 2018 10:07 AM|DA924|LINK
There three types of dependency injections , which are constructor injection, setter injection and method injection. The IoC is just the container to hold object instances, like Unity, Ninject , Castel Windsor just to name a few.
May 24, 2018 10:30 AM|PatriceSc|LINK
This is for ASP.NET Core (NOT ASP.NET 4.x) but I find
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-2.0 to be quite good. In short the idea is to not instantiate a class everywhere but to register the "services" you need once for all and then use those registered
services (allowing them for example to be easily replaceable).
Try also https://en.wikipedia.org/wiki/Dependency_injection