Easy.Extensions.DependencyInjection 1.0.5

dotnet add package Easy.Extensions.DependencyInjection --version 1.0.5
                    
NuGet\Install-Package Easy.Extensions.DependencyInjection -Version 1.0.5
                    
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="Easy.Extensions.DependencyInjection" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Easy.Extensions.DependencyInjection" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="Easy.Extensions.DependencyInjection" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Easy.Extensions.DependencyInjection --version 1.0.5
                    
#r "nuget: Easy.Extensions.DependencyInjection, 1.0.5"
                    
#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.
#:package Easy.Extensions.DependencyInjection@1.0.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Easy.Extensions.DependencyInjection&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=Easy.Extensions.DependencyInjection&version=1.0.5
                    
Install as a Cake Tool

依赖注入

  • 自动注册

    1.普通类型注册,在类型上使用 [RegisterAttribute] 特性
    2.工厂注册,类型实现 IRegisterFactory<TService,TServiceLifetime> 接口
    3.<IServiceCollection>.AutoRegister([assemblies]);
    
    注:
    assemblies 是添加 [RegisterAttribute] 特性或者实现 IRegisterFactory 接口的程序集集合
    
  • 自动注入

    1.属性自动注入
    2.字段自动注入
    
    在需要自动注入的属性或字段上使用 [InjectAttribute] 特性即可
    
  • 获取Easy服务提供商

    <IServiceCollection>.BuildEasyServiceProvider();
    
  • 替换默认服务提供商

    <IHostBuilder>.UseServiceProviderFactory(new EasyServiceProviderFactory([EasyServiceProviderOptions]));
    

更新日志

1.0.0

  • 发布第一个正式版

1.0.1-beta1

  • 为服务提供商工厂添加无参构造函数(默认从当前程序域中所有程序集扫描要注册的服务)

1.0.1-beta2

  • 解决当前项目依赖问题

1.0.1

  • Easy.Extensions.DependencyInjection 的服务提供商实现AOP

1.0.2

  • 修复事件(AOP)中服务提供商参数类型异常问题

1.0.3

  • 修复 1.0.2 版本依赖问题

1.0.4

  • 减少创建服务提供商时的大量反射
  • 去除创建范围时使用反射创建服务提供商范围

1.0.5

  • 移除创建服务提供商时的所有反射
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  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 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.0.5 627 6/28/2022
1.0.4 593 6/26/2022
1.0.3 581 5/25/2022
1.0.2 584 5/25/2022
1.0.1 594 5/24/2022
1.0.1-beta2 350 5/6/2022
1.0.1-beta1 334 5/6/2022
1.0.0 590 5/5/2022
1.0.0-beta9 310 5/1/2022
1.0.0-beta8 321 4/27/2022
1.0.0-beta3 351 4/15/2022