Rystem.DependencyInjection.Web 6.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Rystem.DependencyInjection.Web --version 6.1.0                
NuGet\Install-Package Rystem.DependencyInjection.Web -Version 6.1.0                
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="Rystem.DependencyInjection.Web" Version="6.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rystem.DependencyInjection.Web --version 6.1.0                
#r "nuget: Rystem.DependencyInjection.Web, 6.1.0"                
#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 Rystem.DependencyInjection.Web as a Cake Addin
#addin nuget:?package=Rystem.DependencyInjection.Web&version=6.1.0

// Install Rystem.DependencyInjection.Web as a Cake Tool
#tool nuget:?package=Rystem.DependencyInjection.Web&version=6.1.0                

What is Rystem?

Get Started with Runtime Dependency Injection

Adding runtime provider

 builder.Services.AddRuntimeServiceProvider();

and after the build use the runtime provider

var app = builder.Build();
app.UseRuntimeServiceProvider();

Add service at runtime

await RuntimeServiceProvider.GetServiceCollection()
       .AddSingleton<Service2>()
       .RebuildAsync();

Add service at runtime with lock

 await RuntimeServiceProvider
    .AddServicesToServiceCollectionWithLock(configureFurtherServices =>
    {
        configureFurtherServices.AddSingleton(service);
    })
.RebuildAsync();

Add fallback for Factory and automatic rebuild of service collection

In this example Factorized is a simple class with a few parameters.

services.AddFactory<Factorized>("1");
services.AddActionAsFallbackWithServiceCollectionRebuilding<Factorized>(async x =>
{
    //example of retrievieng something
    await Task.Delay(1); 
    //example of ServiceProvider usage during new service addition
    var singletonService = x.ServiceProvider.GetService<SingletonService>();
    if (singletonService != null)
    {
        //example of adding a new service as factory to the service collection. You need to pass a delegate.
        x.ServiceColletionBuilder = (serviceCollection => serviceCollection.AddFactory<Factorized>(x.Name));
    }
});
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Rystem.DependencyInjection.Web:

Package Downloads
Rystem.Test.XUnit

Rystem is a open-source framework to improve the System namespace in .Net

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
9.0.8 3 1/6/2025
9.0.7 25 1/6/2025
9.0.5 18,217 12/30/2024
9.0.4 91,421 12/23/2024
9.0.3 87 12/22/2024
9.0.2 10,642 12/21/2024
9.0.1 1,128 12/21/2024
9.0.0 172,981 11/16/2024
9.0.0-rc.1 90 10/18/2024
6.2.0 218,943 10/9/2024
6.1.1 107 10/9/2024
6.1.0 47,853 9/29/2024
6.0.24 142 9/11/2024
6.0.23 340,067 7/18/2024
6.0.21 142 6/18/2024
6.0.20 727,780 6/16/2024
6.0.19 30,378 6/14/2024
6.0.18 129 6/14/2024
6.0.17 122 6/14/2024
6.0.16 49,969 6/10/2024
6.0.15 105 6/10/2024