TanvirArjel.Extensions.Microsoft.DependencyInjection
1.0.1
See the version list below for details.
dotnet add package TanvirArjel.Extensions.Microsoft.DependencyInjection --version 1.0.1
NuGet\Install-Package TanvirArjel.Extensions.Microsoft.DependencyInjection -Version 1.0.1
<PackageReference Include="TanvirArjel.Extensions.Microsoft.DependencyInjection" Version="1.0.1" />
<PackageVersion Include="TanvirArjel.Extensions.Microsoft.DependencyInjection" Version="1.0.1" />
<PackageReference Include="TanvirArjel.Extensions.Microsoft.DependencyInjection" />
paket add TanvirArjel.Extensions.Microsoft.DependencyInjection --version 1.0.1
#r "nuget: TanvirArjel.Extensions.Microsoft.DependencyInjection, 1.0.1"
#:package TanvirArjel.Extensions.Microsoft.DependencyInjection@1.0.1
#addin nuget:?package=TanvirArjel.Extensions.Microsoft.DependencyInjection&version=1.0.1
#tool nuget:?package=TanvirArjel.Extensions.Microsoft.DependencyInjection&version=1.0.1
How do I get started?
First, install the latest version of this NuGet package into your project as follows:
Install-Package TanvirArjel.Extensions.Microsoft.DependencyInjection
Using Marker Interface:
Now let your services to inherit any of the ITransientService, IScoperService, and ISingletonService marker interfaces as follows:
// Inherit `IScopedService` interface if you want to register `IEmployeeService` as scoped service.
public class IEmployeeService : IScopedService
{
Task CreateEmployeeAsync(Employee employee);
}
internal class EmployeeService : IEmployeeService
{
public async Task CreateEmployeeAsync(Employee employee)
{
// Implementation here
};
}
Using Attribute:
Now mark your services with any of the ScopedServiceAttribute, TransientServiceAttribute, and SingletonServiceAttribute attributes as follows:
// Mark with ScopedServiceAttribute if you want to register `IEmployeeService` as scoped service.
[ScopedService]
public class IEmployeeService
{
Task CreateEmployeeAsync(Employee employee);
}
internal class EmployeeService : IEmployeeService
{
public async Task CreateEmployeeAsync(Employee employee)
{
// Implementation here
};
}
Now in your ConfigureServices method of the Startup class:
public static void ConfigureServices(IServiceCollection services)
{
services.AddServicesOfType<IScopedService>();
services.AddServicesWithAttributeOfType<ScopedServiceAttribute>();
}
For more documentation details, please visit: GitHub Repository
| 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. 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 | netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
-
.NETStandard 2.1
-
net5.0
NuGet packages (1)
Showing the top 1 NuGet packages that depend on TanvirArjel.Extensions.Microsoft.DependencyInjection:
| Package | Downloads |
|---|---|
|
gomake-common-library
Package Description |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on TanvirArjel.Extensions.Microsoft.DependencyInjection:
| Repository | Stars |
|---|---|
|
TanvirArjel/EFCore.GenericRepository
This repository contains Generic Repository implementation for Entity Framework Core
|
|
|
TanvirArjel/CleanArchitecture
This repository contains the implementation of domain-driven design and clear architecture in ASP.NET Core.
|
1. XML comment issue has been fixed.