Overview of Pure.DI
masterPure.DI is a compile-time dependency injection (DI) code generator for .NET. Unlike traditional DI frameworks that rely on runtime reflection and dynamic instantiation, Pure.DI generates straightforward C# code that performs object composition through nested constructor invocations. This results in zero runtime overhead and allows for compile-time validation of dependency graphs.
Key Benefits:
- Zero Overhead: No reflection or dynamic instantiation; performance is identical to manual object creation.
- Compile-Time Validation: Detects missing dependencies, cyclic references, and injection errors during compilation rather than at runtime.
- High Portability: Works on .NET Framework 2.0+, .NET Core, .NET 5+, UWP/Xbox, .NET IoT, Unity, Xamarin, and Native AOT.
- Transparency: The generated code is viewable and debuggable.