BitzArt.DependencyInjection.TransientServiceProvider 1.2.0

Prefix Reserved
Suggested Alternatives

BitzArt.TransientServiceProvider

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package BitzArt.DependencyInjection.TransientServiceProvider --version 1.2.0
                    
NuGet\Install-Package BitzArt.DependencyInjection.TransientServiceProvider -Version 1.2.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="BitzArt.DependencyInjection.TransientServiceProvider" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BitzArt.DependencyInjection.TransientServiceProvider" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="BitzArt.DependencyInjection.TransientServiceProvider" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BitzArt.DependencyInjection.TransientServiceProvider --version 1.2.0
                    
#r "nuget: BitzArt.DependencyInjection.TransientServiceProvider, 1.2.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.
#:package BitzArt.DependencyInjection.TransientServiceProvider@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BitzArt.DependencyInjection.TransientServiceProvider&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=BitzArt.DependencyInjection.TransientServiceProvider&version=1.2.0
                    
Install as a Cake Tool

NuGet version NuGet downloads

Overview

BitzArt.DependencyInjection.TransientServiceProvider is a NuGet package that allows the creation of transient service providers - each with its own set of services. Transient service providers are isolated from each other and from the default service provider.

How it Works

1. Install

You can install the package via NuGet using the following command:

dotnet add package BitzArt.DependencyInjection.TransientServiceProvider

2. Configure

Add transient service provider factory to your service collection:

services.AddTransientServiceProvider(serviceCollection =>
    {
        // Add services to the serviceCollection here.
    });

3. Resolve

Once the configuration is complete, you can resolve ITransientServiceProvider

  • either directly from the root service provider
var transient = serviceProvider.GetRequiredService<ITransientServiceProvider>();
  • or by injecting it into one of your classes
public class MyService(ITransientServiceProvider transientServiceProvider)
{
    // ...
}

4. Use

Use the resolved ITransientServiceProvider similarly to how you would use a normal IServiceProvider

var myTransientService = transientServiceProvider.GetService<MyService>();
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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