![]() |
VOOZH | about |
dotnet add package AttributeBasedRegistration --version 2.3.0
NuGet\Install-Package AttributeBasedRegistration -Version 2.3.0
<PackageReference Include="AttributeBasedRegistration" Version="2.3.0" />
<PackageVersion Include="AttributeBasedRegistration" Version="2.3.0" />Directory.Packages.props
<PackageReference Include="AttributeBasedRegistration" />Project file
paket add AttributeBasedRegistration --version 2.3.0
#r "nuget: AttributeBasedRegistration, 2.3.0"
#:package AttributeBasedRegistration@2.3.0
#addin nuget:?package=AttributeBasedRegistration&version=2.3.0Install as a Cake Addin
#tool nuget:?package=AttributeBasedRegistration&version=2.3.0Install as a Cake Tool
👁 NuGet
👁 NuGet
👁 Build Status
👁 GitHub License
👁 Static Badge
Library allowing registering services with Autofac and Microsoft's DI container via attributes.
Set of attributes allowing automatic registration:
The usage of the Lifetime attribute versus supplying the lifetime to the ServiceImplementation is per users taste, the data from the more specific attribute will take precedence.
Similar to the above, using multiple RegisterAs or InterceptedBy attributes versus one and supplying multiple types is per users taste - types will be aggregated from all attributes.
To let the auto registration process pick up your services via attributes use the extensions method on ContainerBuilder or IServiceCollection provided by the library:
builder.AddAttributeDefinedServices(assembliesToScan);
Documentation available at https://mikym.github.io/AttributeBasedRegistration/.
public interface ICustomService1
{
}
[ServiceImplementation]
[RegisterAs<ICustomService>)]
[Lifetime(ServiceLifetime.InstancePerLifetimeScope)]
[DecoratedBy(1, typeof(ISomeDecorator))]
[EnableInterception(InterceptionStrategy.Interface)]
[InterceptedBy(1, typeof(ISomeInterceptor))]
public class CustomService1 : ICustomService1
{
}
public interface ICustomService2
{
}
[ServiceImplementation<ICustomService2>(ServiceLifetime.SingleInstance)]
public class CustomService2 : ICustomService2
{
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on AttributeBasedRegistration:
| Package | Downloads |
|---|---|
|
DataExplorer
Library featuring an opinionated, reusable data access layer offering abstractions and implementations for SQL storages (EF Core). |
|
|
ResultCommander
Library featuring a command handler pattern. |
|
|
AttributeBasedRegistration.Autofac
Extensions to Autofac DI mainly allowing registration of services via attributes amongst other minor things. |
|
|
ResultCQRS
Library featuring CQRS pattern. |
|
|
DataExplorer.Unstable
Library featuring common patterns in regard to working with data storages. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.0 | 4,070 | 5/23/2025 |
| 2.2.7 | 4,589 | 7/23/2024 |
| 2.2.6 | 2,436 | 1/24/2024 |
| 2.2.5 | 348 | 1/22/2024 |
| 2.2.4 | 208 | 1/22/2024 |
| 2.2.3 | 742 | 11/22/2023 |
| 2.2.2 | 731 | 11/20/2023 |
| 2.2.1 | 234 | 11/20/2023 |
| 2.2.0 | 334 | 11/20/2023 |
| 2.1.3 | 1,919 | 8/18/2023 |
| 2.1.2 | 1,226 | 7/10/2023 |
| 2.1.1 | 2,042 | 4/3/2023 |
| 2.1.0 | 1,685 | 3/14/2023 |
| 2.0.10 | 4,768 | 1/9/2023 |
| 2.0.9 | 1,416 | 12/22/2022 |
| 2.0.8 | 574 | 12/22/2022 |
| 2.0.7 | 452 | 12/22/2022 |
| 2.0.6 | 1,375 | 11/21/2022 |
| 2.0.5 | 1,658 | 11/19/2022 |
| 2.0.4 | 1,095 | 11/19/2022 |