AuserIoc 1.1.3

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                
#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                

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();

生命周期管理

支持多种生命周期:

  • 单例: 多个容器内共享一个实例。
  • 瞬态: 每次请求创建新实例。
  • 容器范围:容器内共享一个实例。

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
Product 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.

Version Downloads Last updated
1.1.3 53 1/2/2025
1.1.2 65 1/1/2025
1.0.3 89 12/9/2024
1.0.2 89 12/6/2024
1.0.1 85 12/3/2024
1.0.0 89 12/3/2024