Pure.DI 2.1.10

dotnet add package Pure.DI --version 2.1.10
NuGet\Install-Package Pure.DI -Version 2.1.10
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pure.DI" Version="2.1.10">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pure.DI --version 2.1.10
#r "nuget: Pure.DI, 2.1.10"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Pure.DI as a Cake Addin
#addin nuget:?package=Pure.DI&version=2.1.10

// Install Pure.DI as a Cake Tool
#tool nuget:?package=Pure.DI&version=2.1.10

Pure DI for .NET

<a href="https://t.me/pure_di"><img src="https://github.com/DevTeam/Pure.DI/blob/master/readme/telegram.png" align="left" height="20" width="20" ></a> NuGet License Build Build

alternate text is missing from this package README image

Key features

Pure.DI is not a framework or library, but a source code generator for creating object graphs. To make them accurate, the developer uses a set of intuitive hints from the Pure.DI API. During the compilation phase, Pure.DI determines the optimal graph structure, checks its correctness, and generates partial class code to create object graphs in the Pure DI paradigm using only basic language constructs. The resulting generated code is robust, works everywhere, throws no exceptions, does not depend on .NET library calls or .NET reflections, is efficient in terms of performance and memory consumption, and is subject to all optimizations. This code can be easily integrated into an application because it does not use unnecessary delegates, additional calls to any methods, type conversions, boxing/unboxing, etc.

  • DI without any IoC/DI containers, frameworks, dependencies and hence no performance impact or side effects.

    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.

  • A predictable and verified dependency graph is built and validated on the fly while writing code.

    All logic for analyzing the graph of objects, constructors and methods takes place at compile time. Pure.DI notifies the developer at compile time about missing or ring 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.

  • Does not add any dependencies to other assemblies.

    When using pure DI, no dependencies are added to assemblies because only basic language constructs and nothing more are used.

  • Highest performance, including compiler and JIT optimization and minimal memory consumption.

    All generated code runs as fast as your own, in pure DI style, including compile-time and run-time optimization. As mentioned above, graph analysis is done at compile time, and at runtime there are only a bunch of nested constructors, and that's it. Memory is spent only on the object graph being created.

  • It 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.

  • Ease of Use.

    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.

  • Superfine customization of generic types.

    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.

  • Supports the major .NET BCL types out of the box.

    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.

  • Good for building libraries or frameworks where resource consumption is particularly critical.

    Its high performance, zero memory consumption/preparation overhead, and lack of dependencies make it ideal for building libraries and frameworks.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on Pure.DI:

Repository Stars
danielpalme/IocPerformance
Performance comparison of .NET IoC containers
DevTeam/Pure.DI
Pure DI for .NET without frameworks!
OpenRakis/Spice86
Reverse engineer and rewrite real mode DOS programs!
Version Downloads Last updated
2.1.10 45 4/18/2024
2.1.9 209 4/13/2024
2.1.8 297 4/3/2024
2.1.7 519 3/17/2024
2.1.6 105 3/14/2024
2.1.5 338 3/8/2024
2.1.4 268 3/7/2024
2.1.3 302 2/29/2024
2.1.2 279 2/19/2024
2.1.1 111 2/16/2024
2.1.0 133 2/14/2024
2.0.49 303 2/8/2024
2.0.48 166 2/1/2024
2.0.47 308 1/21/2024
2.0.46 127 1/20/2024
2.0.45 240 1/18/2024
2.0.44 121 1/17/2024
2.0.43 103 1/17/2024
2.0.42 199 1/16/2024
2.0.41 88 1/16/2024
2.0.40 130 1/15/2024
2.0.39 329 1/12/2024
2.0.38 171 1/10/2024
2.0.37 119 1/9/2024
2.0.36 199 1/5/2024
2.0.35 275 12/29/2023
2.0.34 175 12/28/2023
2.0.32 122 12/27/2023
2.0.31 111 12/27/2023
2.0.30 308 12/25/2023
2.0.29 159 12/21/2023
2.0.28 94 12/21/2023
2.0.27 247 12/18/2023
2.0.26 297 12/3/2023
2.0.24 884 11/18/2023
2.0.23 615 11/3/2023
2.0.22 261 10/25/2023
2.0.21 274 10/24/2023
2.0.20 242 10/16/2023
2.0.19 611 9/23/2023
2.0.17 201 9/22/2023
2.0.15 1,424 8/22/2023
2.0.14 671 8/11/2023
2.0.13 218 8/11/2023
2.0.12 333 8/8/2023
1.1.64 3,248 6/22/2023
1.1.63 3,158 12/29/2022
1.1.62 597 11/18/2022
1.1.61 368 11/12/2022
1.1.60 454 10/22/2022
1.1.59 482 10/16/2022
1.1.58 394 10/13/2022
1.1.57 393 10/12/2022
1.1.56 443 10/10/2022
1.1.55 805 10/2/2022
1.1.54 430 10/1/2022
1.1.53 607 9/16/2022
1.1.52 499 9/11/2022
1.1.51 453 9/9/2022
1.1.50 550 9/2/2022
1.1.49 406 9/2/2022
1.1.48 434 9/2/2022
1.1.47 607 8/17/2022
1.1.46 527 8/7/2022
1.1.45 696 7/8/2022
1.1.44 554 6/24/2022
1.1.43 525 6/19/2022
1.1.42 457 6/19/2022
1.1.41 467 6/15/2022
1.1.40 481 6/10/2022
1.1.39 532 6/9/2022
1.1.38 483 6/8/2022
1.1.37 504 6/5/2022
1.1.35 930 3/4/2022
1.1.34 444 3/4/2022
1.1.33 444 3/1/2022
1.1.32 603 2/8/2022
1.1.31 438 2/7/2022
1.1.30 443 2/7/2022
1.1.29 454 2/7/2022
1.1.28 438 2/7/2022
1.1.27 439 2/6/2022
1.1.26 517 2/3/2022
1.1.25 509 1/28/2022
1.1.23 438 1/27/2022
1.1.22 487 1/21/2022
1.1.21 478 1/18/2022
1.1.20 476 1/11/2022
1.1.19 346 12/2/2021
1.1.18 346 11/16/2021
1.1.17 312 11/15/2021
1.1.16 338 11/12/2021
1.1.15 322 11/12/2021
1.1.14 410 11/8/2021
1.1.13 393 11/1/2021
1.1.11 402 10/26/2021
1.1.10 327 10/20/2021
1.1.9 362 10/19/2021
1.1.8 339 10/17/2021
1.1.7 357 10/17/2021
1.1.6 339 10/17/2021
1.1.5 372 10/16/2021
1.1.4 333 10/15/2021
1.1.3 408 10/7/2021
1.1.2 336 10/6/2021
1.1.1 464 10/3/2021
1.1.0 383 9/30/2021
1.0.6 345 9/23/2021
1.0.5 372 9/6/2021
1.0.4 383 8/6/2021
1.0.3 382 8/3/2021
1.0.2 343 8/2/2021
1.0.1 339 7/14/2021