AuserIoc 1.1.3
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Framework 4.6.2
This package targets .NET Framework 4.6.2. The package is compatible with this framework or higher.
dotnet add package AuserIoc --version 1.1.3
NuGet\Install-Package AuserIoc -Version 1.1.3
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="AuserIoc" Version="1.1.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AuserIoc --version 1.1.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AuserIoc, 1.1.3"
#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 AuserIoc as a Cake Addin #addin nuget:?package=AuserIoc&version=1.1.3 // Install AuserIoc as a Cake Tool #tool nuget:?package=AuserIoc&version=1.1.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AuserIoc
介绍
AuserIoc 是一个轻量级的依赖注入(IOC)容器,旨在提供高效、易用的对象管理和依赖关系解析功能。它适用于需要灵活管理对象生命周期和依赖注入的 .NET 应用程序。
功能特色
- 依赖注入支持:支持构造函数注入和方法参数注入。
- 生命周期管理:支持单例、瞬态等多种对象生命周期。
- 模块化设计:通过构建器模式和扩展方法轻松自定义。
- 异常处理:清晰的异常定义,便于调试和错误排查。
软件架构
支持net4.6.2、net4.7.2、net4.8.1、net6、net8、net9
安装
dotnet add package AuserIoc
使用方法
注册对象
var containerBuilder = new IocContainerBuilder();
containerBuilder.Register<IService, ServiceImplementation>();
var container = containerBuilder.Build();
获取对象实例
var service = container.Resolve<IService>();
service.DoSomething();
生命周期管理
支持多种生命周期:
- 单例: 多个容器内共享一个实例。
- 瞬态: 每次请求创建新实例。
- 容器范围:容器内共享一个实例。
参与贡献
- Fork 本仓库
- 新建 Feat_xxx 分支
- 提交代码
- 新建 Pull Request
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. net9.0 is compatible. |
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.2
- No dependencies.
-
.NETFramework 4.7.2
- No dependencies.
-
.NETFramework 4.8.1
- No dependencies.
-
net6.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.