Pure.DI.Templates
2.1.58
Prefix Reserved
See the version list below for details.
dotnet new install Pure.DI.Templates::2.1.58
Supports .NET starting with .NET Framework 2.0, released 2005-10-27, and all newer versions.
Usage requirements
Usage Requirements
- .NET SDK 6.0.4+
Required for compilation. Projects can target older frameworks (e.g., .NET Framework 2.0). - C# 8+
Only required for projects using the Pure.DI source generator. Other projects support any C# version.
Key Features
Pure.DI is a compile-time dependency injection (DI) code generator that replaces runtime containers with lightweight, well-optimized code.
✔️ No Containers, Zero Overhead
Pure.DI is actually a .NET code generator. It uses basic language constructs to create simple code as well as if you were doing it yourself: de facto it's just a bunch of nested constructor calls. This code can be viewed, analyzed at any time, and debugged.
✔️ Compile-Time Validation
All logic for analyzing the graph of objects, constructors and methods takes place at compile time. Pure.DI notifies the developer at compile time of missing or cyclic dependencies, cases when some dependencies are not suitable for injection, etc. The developer has no chance to get a program that will crash at runtime because of some exception related to incorrect object graph construction. All this magic happens at the same time as the code is written, so you have instant feedback between the fact that you have made changes to your code and the fact that your code is already tested and ready to use.
✔️ Zero Dependencies
No external libraries.
✔️ Native Performance
- Compiler/JIT Optimized: Matches hand-written code efficiency.
- Minimal Memory: Allocates only necessary objects. No boxing, delegates, or dynamic calls.
✔️ Works everywhere
Since the pure DI approach does not use any dependencies or .NET reflection at runtime, it does not prevent the code from running as expected on any platform: Full .NET Framework 2.0+, .NET Core, .NET, UWP/XBOX, .NET IoT, Xamarin, Native AOT, etc.
✔️ Familiar Syntax
The Pure.DI API is very similar to the API of most IoC/DI libraries. And this was a conscious decision: the main reason is that programmers don't need to learn a new API.
✔️ Precise Generics
In Pure.DI it is proposed to use special marker types instead of using open generic types. This allows you to build the object graph more accurately and take full advantage of generic types.
✔️ Built-in BCL Support
Pure.DI already supports many of BCL types like Array
, IEnumerable<T>
, IList<T>
, IReadOnlyCollection<T>
, IReadOnlyList<T>
, ISet<T>
, IProducerConsumerCollection<T>
, ConcurrentBag<T>
, Func<T>
, ThreadLocal
, ValueTask<T>
, Task<T>
, MemoryPool<T>
, ArrayPool<T>
, ReadOnlyMemory<T>
, Memory<T>
, ReadOnlySpan<T>
, Span<T>
, IComparer<T>
, IEqualityComparer<T>
and etc. without any extra effort.
✔️ Ideal for Libraries
Its high performance, zero memory consumption/preparation overhead, and lack of dependencies make it ideal for building libraries and frameworks.
NuGet packages
NuGet package | Description |
---|---|
Pure.DI | DI source code generator |
Pure.DI.Abstractions | Abstractions for Pure.DI |
Pure.DI.Templates | Template package, for creating projects from the shell/command line |
Pure.DI.MS | Add-ons on Pure.DI to work with Microsoft DI |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.1.59 | 128 | 2/27/2025 |
2.1.58 | 138 | 2/25/2025 |
2.1.57 | 114 | 2/20/2025 |
2.1.56 | 402 | 2/7/2025 |
2.1.55 | 128 | 2/5/2025 |
2.1.54 | 122 | 2/4/2025 |
2.1.53 | 242 | 1/25/2025 |
2.1.52 | 154 | 1/22/2025 |
2.1.51 | 141 | 1/17/2025 |
2.1.50 | 153 | 1/16/2025 |
2.1.49 | 146 | 1/10/2025 |
2.1.47 | 185 | 12/27/2024 |
2.1.46 | 123 | 12/26/2024 |
2.1.45 | 119 | 12/24/2024 |
2.1.44 | 156 | 12/20/2024 |
2.1.43 | 121 | 12/19/2024 |
2.1.42 | 138 | 12/17/2024 |
2.1.41 | 228 | 11/28/2024 |
2.1.40 | 138 | 11/21/2024 |
2.1.38 | 192 | 11/15/2024 |
2.1.36 | 745 | 9/13/2024 |
2.1.35 | 140 | 9/5/2024 |
2.1.34 | 143 | 8/28/2024 |
2.1.33 | 168 | 8/24/2024 |
2.1.32 | 148 | 8/21/2024 |
2.1.31 | 171 | 8/12/2024 |
2.1.30 | 142 | 8/10/2024 |
2.1.29 | 118 | 8/2/2024 |
2.1.28 | 142 | 7/24/2024 |
2.1.25 | 230 | 7/2/2024 |
2.1.24 | 147 | 6/26/2024 |
2.1.23 | 223 | 6/7/2024 |
2.1.22 | 335 | 5/23/2024 |
2.1.21 | 166 | 5/21/2024 |
2.1.20 | 134 | 5/20/2024 |
2.1.19 | 226 | 5/17/2024 |
2.1.18 | 146 | 5/16/2024 |
2.1.17 | 129 | 5/15/2024 |
2.1.15 | 342 | 5/7/2024 |
2.1.14 | 166 | 4/27/2024 |
2.1.11 | 137 | 4/26/2024 |
2.1.10 | 143 | 4/18/2024 |
2.1.4 | 714 | 3/7/2024 |
2.1.3 | 317 | 2/29/2024 |
2.1.2 | 219 | 2/27/2024 |
2.0.5 | 1,878 | 12/29/2023 |
2.0.4 | 230 | 12/27/2023 |
2.0.3 | 1,599 | 11/5/2023 |
2.0.1 | 249 | 11/4/2023 |
2.0.0 | 444 | 7/18/2023 |
1.0.5 | 709 | 10/16/2022 |
1.0.4 | 573 | 6/19/2022 |
1.0.3 | 465 | 6/17/2022 |
1.0.2 | 443 | 9/30/2021 |
1.0.1 | 562 | 8/26/2021 |