Home

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:

  1. Add the [Component] attribute on your classes:
[Component]
public class MyService : IShoppingService
{
    public MyService(IShoppingRepository repos)
	{
	}
	
	// [...]
}

[Component]
public class SqlServerShoppingRepository : IShoppingRepository
{
    public SqlServerShoppingRepository()
	{
	}
	
	// [...]
}
  1. Register all decorated classes in the container:
var registrar = new ContainerRegistrar();
registrar.RegisterComponents(Lifetime.Scoped, Assembly.GetExecutingAssembly());

var container = registrar.Build();

Features

Installation

Install using nuget:

Documentation

Pull requests are welcome.