A small, self-contained Dependency Injection (DI) framework for .NET, designed with simplicity and minimal dependencies in mind. Built from scratch using plain reflection and System.Linq.Expressions, it has no dependency on any third‑party IoC container.
Key features:
- Fluent binding API (similar in spirit to Ninject/Autofac)
- Scoped and hierarchical containers
- Decorator support
- Convention-based auto-registration
- Reachability validation
Designed for:
- .NET Standard 2.0+ (works in Unity, legacy projects, and modern .NET)
- Libraries and plugins where keeping external dependencies low is important
// DIContainer is an internal name.
DIContainer container = new DIContainer();
// ---Bindings---
// Explicit separation of registration and resolve stages
container.Bind<IService>().To<Service>().AsSingle();
container.Bind<IScopedService>().To<ScopedService>().AsScoped();
// --------------
// Required for building and validating a dependency graph.
container.Build();
IService service = container.Resolve<IService>();📖 Full documentation, examples, and API reference
📄 License
- AOT support (important for Unity IL2CPP and native publishing).