BigO.DependencyInjection
2.3.0
See the version list below for details.
dotnet add package BigO.DependencyInjection --version 2.3.0
NuGet\Install-Package BigO.DependencyInjection -Version 2.3.0
<PackageReference Include="BigO.DependencyInjection" Version="2.3.0" />
paket add BigO.DependencyInjection --version 2.3.0
#r "nuget: BigO.DependencyInjection, 2.3.0"
// Install BigO.DependencyInjection as a Cake Addin #addin nuget:?package=BigO.DependencyInjection&version=2.3.0 // Install BigO.DependencyInjection as a Cake Tool #tool nuget:?package=BigO.DependencyInjection&version=2.3.0
BigO.DependencyInjection
BigO.DependencyInjection provides a set of utilities to streamline and enhance dependency injection in .NET projects. This package aims to simplify common dependency injection patterns, making your code more maintainable and testable.
Features
- Service Registration: Easily register services with various lifetimes (singleton, scoped, transient).
- Decorator Support: Apply decorators to services seamlessly.
- Factory Registration: Register services with factory methods.
Installation
Install via NuGet Package Manager Console:
Install-Package BigO.DependencyInjection
Or via .NET CLI:
dotnet add package BigO.DependencyInjection
Usage
Registering Services
using BigO.DependencyInjection;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddBigOService<MyService>(ServiceLifetime.Singleton);
}
}
Applying Decorators
services.AddDecoratedService<IMyService, MyService, MyServiceDecorator>(ServiceLifetime.Scoped);
Registering with Factory
services.AddFactoryService<IMyService>(sp => new MyService(sp.GetRequiredService<IOtherService>()));
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any bugs or features.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Product | Versions 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. |
-
net8.0
- JetBrains.Annotations (>= 2024.2.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Scrutor (>= 4.2.2)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on BigO.DependencyInjection:
Package | Downloads |
---|---|
BigO.Cqrs
BigO.Cqrs contains base utilities and extensions dealing with CQRS. |
|
BigO.Domain
A toolset of selected extensions and utilities to assist with learning/development tasks revolving around domain driven design. |
|
BigO.Security
The package contains useful utilities for development around security in .NET. |
GitHub repositories
This package is not used by any popular GitHub repositories.