Sattinos.AutoAdmin.DIImprove
5.0.14
dotnet add package Sattinos.AutoAdmin.DIImprove --version 5.0.14
NuGet\Install-Package Sattinos.AutoAdmin.DIImprove -Version 5.0.14
<PackageReference Include="Sattinos.AutoAdmin.DIImprove" Version="5.0.14" />
paket add Sattinos.AutoAdmin.DIImprove --version 5.0.14
#r "nuget: Sattinos.AutoAdmin.DIImprove, 5.0.14"
// Install Sattinos.AutoAdmin.DIImprove as a Cake Addin
#addin nuget:?package=Sattinos.AutoAdmin.DIImprove&version=5.0.14
// Install Sattinos.AutoAdmin.DIImprove as a Cake Tool
#tool nuget:?package=Sattinos.AutoAdmin.DIImprove&version=5.0.14
Dependency Injection improvements in Asp.net Core
A list of attributes that allows for injecting your services/managers/etc.. directly from your class instead of Startup.cs.
How to use
For ⇐ .net5 projects: Inside <b>Startup.cs</b> file, put the following in the first line of the method: <b>ConfigureServices</b>:
InjectionFactory.StartInjection(services, Configuration, Assembly.GetExecutingAssembly());
After that, follow either of the examples: </br>
Example1:
If you have a service called "NotificationService" that implements the interface "INotificationService" instead of writing
services.AddTransient<INotificationService, NotificationService>();
You can write directly in the NotificationService.cs class: </br>
[InjectAs(ServiceLifetime.Transient, typeof(INotificationService))]
public class NotificationService {
.
.
.
}
Example2:
If you have a configuration section "JwtSettings" in appsettings.json instead of writing:
services.Configure<JwtAuthSettings>(Configuration.GetSection("JwtSettings"));
You can write directly in the JwtAuthSettings.cs class: </br>
[InjectAsConfigureSection("JwtSettings")]
public class JwtAuthSettings {
.
.
.
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. 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. |
-
net5.0
- Microsoft.Extensions.Configuration (>= 6.0.1)
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 6.0.0)
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 |
---|---|---|
5.0.14 | 191 | 7/31/2022 |
.net 5 release