Easy.Extensions.DependencyInjection.Abstractions 1.0.1

dotnet add package Easy.Extensions.DependencyInjection.Abstractions --version 1.0.1
                    
NuGet\Install-Package Easy.Extensions.DependencyInjection.Abstractions -Version 1.0.1
                    
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.Abstractions" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Easy.Extensions.DependencyInjection.Abstractions" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Easy.Extensions.DependencyInjection.Abstractions" />
                    
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.Abstractions --version 1.0.1
                    
#r "nuget: Easy.Extensions.DependencyInjection.Abstractions, 1.0.1"
                    
#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.Abstractions@1.0.1
                    
#: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.Abstractions&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Easy.Extensions.DependencyInjection.Abstractions&version=1.0.1
                    
Install as a Cake Tool

依赖注入(抽象)

  • key服务注册

    // 瞬时
    <IServiceCollection>.AddTransient(serviceType,implementationType,key);
    ...
    // 范围
    <IServiceCollection>.AddScoped(serviceType,implementationType,key);
    ...
    // 单例
    <IServiceCollection>.AddSingleton(serviceType,implementationType,key);
    ...
    
  • key服务获取

    IServiceProvider.GetService<TService>(key);
    IServiceProvider.GetRequiredService<TService>(key);
    IServiceProvider.GetServices<TService>(key);
    
  • 接口形式的服务生命周期

    // 瞬时
    ILifetimeTransient
    // 范围
    ILifetimeScoped
    // 单例
    ILifetimeSingleton
    
    三个接口都继承自 IServiceLifetime
    
    可使用 ServiceLifetimeExtension.GetLifetime(Type); 获取到 ServiceLifetime 类型数据
    
  • 服务类型面具

    // 创建类型面具
    Type.WearMask(string);
    ServiceTypeMaskExtensions.WearMask(Type,string);
    
    // 创建微软key的面具
    Type.WearMicrosoftMask();
    ServiceTypeMaskExtensions.WearMicrosoftMask(Type);
    

更新日志

1.0.0

发布第一个正式版

1.0.1-beta1

1.解决 Easy.Extensions.DependencyInjection 依赖问题

1.0.1

1.ServiceTypeProxy 类修改成 ServiceTypeMask ,服务类型面具的意思
2.ServiceTypeProxyExtensions 类修改成 ServiceTypeMaskExtensions
3.增加服务类型面具功能
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 (1)

Showing the top 1 NuGet packages that depend on Easy.Extensions.DependencyInjection.Abstractions:

Package Downloads
Easy.Extensions.DependencyInjection

依赖注入

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 1,840 5/24/2022
1.0.1-beta1 341 5/6/2022
1.0.0 770 5/5/2022
1.0.0-beta9 277 5/1/2022
1.0.0-beta8 301 4/27/2022
1.0.0-beta3 314 4/15/2022