Asya.DependencyInjection 1.0.0

.NET 5.0
Install-Package Asya.DependencyInjection -Version 1.0.0
dotnet add package Asya.DependencyInjection --version 1.0.0
<PackageReference Include="Asya.DependencyInjection" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Asya.DependencyInjection --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Asya.DependencyInjection, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Asya.DependencyInjection as a Cake Addin
#addin nuget:?package=Asya.DependencyInjection&version=1.0.0

// Install Asya.DependencyInjection as a Cake Tool
#tool nuget:?package=Asya.DependencyInjection&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Asya Dependency Injection a lightweight dependency injection assembly scanner

you can simply inject your dependencies with a smart attribute decoration and let the package take of your DI registration for the 4 common injection methods (Transient, Singleton, Scoped, Hosted) as following let's talk about the injection after I have created a simple interface with a single method as IExample.cs and implementation as ExampleManager.cs as following

using Asya.DependencyInjection.Attributes; namespace Asya.DependencyInjection { [Scoped] public interface IExample { void Transaction(); } }

and the implementation

using System; namespace Asya.DependencyInjection { public class ExampleManager: IExample { public void Transaction() { throw new NotImplementedException(); } } }

all you want is to mention the attribute as decoration on top of your interface or class you can use one of the following

[Scoped], [Singleton], [Transient], [Hosted]

then in your startup class you can simple inject this with single method as service.ScanDependencies(); which will scan all services around your internal assembly and register each depended on the decoration attribute OR you can analysis you code with register each using the AddServiceOfType<TAttrubite>(); as following AddServiceOfType<Singleton>(); AddServiceOfType<Scoped>(); AddServiceOfType<Transient>(); AddServiceOfType<Hosted>(); which also will scan your assembly to get dependencies

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Asya.DependencyInjection:

Package Downloads
Asya.JwtManager

a lightweight JWT authentication manager thats allow you to work with JWT token easly and safe

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 289 9/5/2021

the initial release