Inversion of control container with (almost) zero configuration
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Source
nuget
.gitignore
License.txt
README.md

README.md

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

  • 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

Pull requests are welcome.