Skip to content

A dependency injection container for registering and resolving types.

License

Notifications You must be signed in to change notification settings

robertcoltheart/inject

Repository files navigation

Inject

NuGet License

A dependency injection container for registering and resolving types.

Usage

Install the package from NuGet with dotnet add package Inject.

Types and instances can be registered in the container, as in the example below. You can also resolve types without registering them, provided that they have only 1 constructor and all of the parameters can also be resolved. The container will throw an exception if any circular dependencies are found.

var container = new InjectContainer();
container.Register<IType, Type>();

var instance = container.Resolve<IType>();

Contributing

Please read CONTRIBUTING.md for details on how to contribute to this project.

License

Inject is released under the MIT License