BitzArt.DependencyInjection.TransientServiceProvider
1.2.0
Prefix Reserved
dotnet add package BitzArt.DependencyInjection.TransientServiceProvider --version 1.2.0
NuGet\Install-Package BitzArt.DependencyInjection.TransientServiceProvider -Version 1.2.0
<PackageReference Include="BitzArt.DependencyInjection.TransientServiceProvider" Version="1.2.0" />
<PackageVersion Include="BitzArt.DependencyInjection.TransientServiceProvider" Version="1.2.0" />
<PackageReference Include="BitzArt.DependencyInjection.TransientServiceProvider" />
paket add BitzArt.DependencyInjection.TransientServiceProvider --version 1.2.0
#r "nuget: BitzArt.DependencyInjection.TransientServiceProvider, 1.2.0"
#:package BitzArt.DependencyInjection.TransientServiceProvider@1.2.0
#addin nuget:?package=BitzArt.DependencyInjection.TransientServiceProvider&version=1.2.0
#tool nuget:?package=BitzArt.DependencyInjection.TransientServiceProvider&version=1.2.0
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 | Versions 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. |
-
net9.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.2)
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 |
|---|