![]() |
VOOZH | about |
dotnet add package Franz.Common.DependencyInjection --version 2.2.7
NuGet\Install-Package Franz.Common.DependencyInjection -Version 2.2.7
<PackageReference Include="Franz.Common.DependencyInjection" Version="2.2.7" />
<PackageVersion Include="Franz.Common.DependencyInjection" Version="2.2.7" />Directory.Packages.props
<PackageReference Include="Franz.Common.DependencyInjection" />Project file
paket add Franz.Common.DependencyInjection --version 2.2.7
#r "nuget: Franz.Common.DependencyInjection, 2.2.7"
#:package Franz.Common.DependencyInjection@2.2.7
#addin nuget:?package=Franz.Common.DependencyInjection&version=2.2.7Install as a Cake Addin
#tool nuget:?package=Franz.Common.DependencyInjection&version=2.2.7Install as a Cake Tool
A core library within the Franz Framework, designed to simplify and enhance the usage of dependency injection in .NET applications. This package provides utilities and extensions for efficient registration of services, managing lifetimes, and ensuring clean dependency resolution.
IScopedDependency with scoped lifetimes.ISingletonDependency with singleton lifetimes.ITypeSourceSelectorExtensions.FromCompanyApplicationDependenciesWithPredicate for targeted registration.-Current Version: v2.2.7
This package relies on:
Since this package is hosted privately, configure your NuGet client:
dotnet nuget add source "https://your-private-feed-url" \
--name "AzurePrivateFeed" \
--username "YourAzureUsername" \
--password "YourAzurePassword" \
--store-password-in-clear-text
Install the package:
dotnet add package Franz.Common.DependencyInjection
Use the ServiceCollectionExtensions to register common dependencies based on their interfaces and lifetimes:
Automatically register all classes implementing IScopedDependency:
using Franz.Common.DependencyInjection.Extensions;
services.AddScopedDependencies();
Automatically register all classes implementing ISingletonDependency:
using Franz.Common.DependencyInjection.Extensions;
services.AddSingletonDependencies();
Use a custom predicate to filter assemblies:
services.AddDependencies(assembly => assembly.GetName().Name.Contains("MyApp"));
Avoid redundant registrations using RegistrationStrategySkipExistingPair:
using Franz.Common.DependencyInjection.Extensions;
services.AddWithStrategy<ILogger, Logger>(new RegistrationStrategySkipExistingPair());
Automatically register services based on reflection:
services.Scan(scan => scan
.FromCompanyApplicationDependenciesWithPredicate(assembly => assembly.GetName().Name.StartsWith("MyCompany"))
.AddClasses(classes => classes.AssignableTo<IService>())
.AsImplementedInterfaces()
.WithScopedLifetime());
Register services with custom rules:
services.AddSelfScoped<IOrderService>();
services.AddMatchingInterfaceScoped<IOrderService>();
services.AddImplementedInterfaceSingleton<IOrderService>();
Ensure no duplicate services are added:
services.AddNoDuplicateScoped<IOrderService, OrderService>();
services.AddNoDuplicateSingleton<ILogger, Logger>();
services.AddNoDuplicateTransient<IService, ServiceImplementation>();
Register classes inheriting from a specific base type:
services.AddInheritedClassSingleton<MyBaseType>();
The Franz.Common.DependencyInjection package integrates seamlessly with:
This package is part of a private framework. Contributions are limited to the internal development team. If you are authorized to contribute:
This library is licensed under the MIT License. See the LICENSE file for more details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on Franz.Common.DependencyInjection:
| Package | Downloads |
|---|---|
|
Franz.Common.Business
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Headers
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Serialization
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Messaging
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Hosting
Shared utility library for the Franz Framework. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.2.7 | 509 | 6/7/2026 |
| 2.2.6 | 510 | 6/6/2026 |
| 2.2.5 | 523 | 6/4/2026 |
| 2.2.4 | 503 | 6/3/2026 |
| 2.2.3 | 494 | 6/2/2026 |
| 2.2.2 | 499 | 6/2/2026 |
| 2.2.1 | 511 | 5/24/2026 |
| 2.1.4 | 422 | 4/27/2026 |
| 2.1.3 | 384 | 4/26/2026 |
| 2.1.2 | 387 | 4/26/2026 |
| 2.1.1 | 395 | 4/22/2026 |
| 2.0.2 | 401 | 3/30/2026 |
| 2.0.1 | 386 | 3/29/2026 |
| 1.7.8 | 409 | 3/2/2026 |
| 1.7.7 | 432 | 1/31/2026 |
| 1.7.6 | 432 | 1/22/2026 |
| 1.7.5 | 407 | 1/10/2026 |
| 1.7.4 | 437 | 12/27/2025 |
| 1.7.3 | 514 | 12/22/2025 |
| 1.7.2 | 502 | 12/21/2025 |