The
terms Dependency Injection (DI) & Inversion of Control (IoC) are
generally used interchangeably to describe the same design pattern.
Hence some people say IoC Container and some people says DI container
but both terms indicate to the same thing. So don't be confused by the
terminology.
What is DI Container
A DI Container is a framework to create dependencies and inject them automatically when required. It automatically creates objects based on the request and injects them when required. DI Container helps us to manage dependencies within the application in a simple and easy way.POOR MAN’S DI
and we have to do more work, to make it configured and manageable. List of popular DI Container for .Net
Today, there are a lot of excellent DI Containers that are available for .NET. Here, I am sharing the list of most useful DI Container for .Net framework.Castle Windsor
- Based on the Castle MicroKernel.
- Well documented and used by many.
- Understands Decorator
- Typed factories
- Commercial support available
StructureMap
- It has been around since June 2004
- It is actively developed and works in many cases
Spring.NET
- INTERCEPTION
- Comprehensive documentation
- Commercial support available
Autofac
- Easy to learn API
- second-generation DI Container
- Commercial support available
Unity
- INTERCEPTION
- Good documentation
- Consistent API
Ninject
- Easy to learn API
- Second-generation DI Container