Awesome
Griffin.Container
Inversion of control container with (almost) zero configuration.
The container configuration is validated when the container is built, to make sure that all dependencies have been registered.
Support for .NET Standard 2.0 and .NET 4.5.2.
Typical setup:
- Add the
[Component]
attribute on your classes:
[Component]
public class MyService : IShoppingService
{
public MyService(IShoppingRepository repos)
{
}
// [...]
}
[Component]
public class SqlServerShoppingRepository : IShoppingRepository
{
public SqlServerShoppingRepository()
{
}
// [...]
}
- Register all decorated classes in the container:
var registrar = new ContainerRegistrar();
registrar.RegisterComponents(Lifetime.Scoped, Assembly.GetExecutingAssembly());
var container = registrar.Build();
Features
- The usual =)
- Configuration validation
- Commands
- Decorators
- Interceptors
- Modules
- Domain events
- Quick enough
Installation
Install using nuget:
- Core:
install-package griffin.container
- MVC5:
install-package griffin.container.mvc5
- WCF:
install-package griffin.container.wcf
- WebApi v2:
install-package griffin.container.webapi2
Documentation
- The article linked above
- Core MSDN style docs
- WCF MSDN style docs
- Forum/Mailing list
Pull requests are welcome.