MRT.NanoDependencyInjector 1.1.6

dotnet add package MRT.NanoDependencyInjector --version 1.1.6
NuGet\Install-Package MRT.NanoDependencyInjector -Version 1.1.6
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="MRT.NanoDependencyInjector" Version="1.1.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MRT.NanoDependencyInjector --version 1.1.6
#r "nuget: MRT.NanoDependencyInjector, 1.1.6"
#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 MRT.NanoDependencyInjector as a Cake Addin
#addin nuget:?package=MRT.NanoDependencyInjector&version=1.1.6

// Install MRT.NanoDependencyInjector as a Cake Tool
#tool nuget:?package=MRT.NanoDependencyInjector&version=1.1.6

NanoDependencyInjector

NanoDependencyInjector is the lightest dependency injector available aiming at simplicity and performance

Functionalities

  • Supports two types of scopes: transient and singleton
  • Three types of dependency injection: via constructor, on marked property or field, on marked method
  • Supports cyclic dependency injection (one of the instances must have the dependency injected via other methods than constructor)
  • Blazing performance by using dynamic methods for each registered type
  • Code based configuration of dependency injector
  • External file configuration using XML format

Usage

Configuration
//put this code at application startup  

//register SimpleClass type as ISimpleClass interface with singleton scope
DiFactory.Kernel.Register<SimpleClass, ISimpleClass>(true);

//register ClassWithCtorDependencies type as IClassWithCtorDependencies interface with transient scope
DiFactory.Kernel.Register<ClassWithCtorDependencies, IClassWithCtorDependencies>(false);

//register SecondClass type as itself with transient scope
DiFactory.Kernel.Register<SecondClass>(false);

//validate dependencies graph
DiFactory.Kernel.Validate();
Usage
DiFactory.Kernel.GetInstance<IClassWithCtorDependencies>();
DiFactory.Kernel.GetInstance<ISimpleClass>();
DiFactory.Kernel.GetInstance<SecondClass>();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETStandard 2.1

    • 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
1.1.6 373 11/2/2021
1.1.5 278 11/2/2021
1.1.4 268 11/2/2021
1.1.3 306 10/29/2021
1.1.2 270 10/29/2021
1.1.0 275 10/28/2021