AttributeBasedRegistration 1.1.3
See the version list below for details.
dotnet add package AttributeBasedRegistration --version 1.1.3
NuGet\Install-Package AttributeBasedRegistration -Version 1.1.3
<PackageReference Include="AttributeBasedRegistration" Version="1.1.3" />
<PackageVersion Include="AttributeBasedRegistration" Version="1.1.3" />
<PackageReference Include="AttributeBasedRegistration" />
paket add AttributeBasedRegistration --version 1.1.3
#r "nuget: AttributeBasedRegistration, 1.1.3"
#:package AttributeBasedRegistration@1.1.3
#addin nuget:?package=AttributeBasedRegistration&version=1.1.3
#tool nuget:?package=AttributeBasedRegistration&version=1.1.3
AttributeBasedRegistration
Library allowing registering services with Autofac and Microsoft's DI container via attributes. Additionally contains various extensions to Autofac and Microsoft's DI container.
Features
Set of attributes allowing automatic registration:
- [ServiceImplementation] - marks the class as an implementation of a service, defines the service type(s) or a registration strategy and the lifetime of the service
- [Intercepted] - marks the service implementation for interception, defines the interceptor types and the interception strategy - supported only with Autofac
- [FindConstructorsWith] - defines a constructor finder to use during creation of the service instance, supports only parameterless ctors and can't be used in conjunction with interceptors - supported only with Autofac
- [Decorated] - marks the service implementation for decoration with a specified decorator and registration order - supported only with Autofac
Installation
To pick up and register services via attributes use the extensions method on ContainerBuilder or IServiceCollection provided by the library:
builder.AddAttributeDefinedServices(assembliesToScan);
Example usage
public interface ICustomService
{
}
[ServiceImplementation(ServiceLifetime.InstancePerLifetimeScope, typeof(ICustomService))]
[Decorated(1, typeof(ISomeDecorator))]
[Intercepted(InterceptionStrategy.Interface, typeof(ISomeInterceptor))]
public class CustomService : ICustomService
{
}
[ServiceImplementation(ServiceLifetime.InstancePerDependency, RegistrationStrategy.AsSelf)]
[Decorated(1, typeof(ISomeDecorator))]
[Intercepted(InterceptionStrategy.Interface, typeof(ISomeInterceptor))]
public class AnotherCustomService
{
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net6.0
- Autofac (>= 6.4.0)
- Autofac.Extensions.DependencyInjection (>= 8.0.0)
- Autofac.Extras.DynamicProxy (>= 6.0.1)
- Castle.Core.AsyncInterceptor (>= 2.1.0)
- JetBrains.Annotations (>= 2022.1.0)
- Microsoft.Extensions.Logging (>= 6.0.0)
- MikyM.Utilities (>= 1.0.2)
NuGet packages (5)
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. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.0 | 2,927 | 5/23/2025 |
| 2.2.7 | 4,555 | 7/23/2024 |
| 2.2.6 | 2,406 | 1/24/2024 |
| 2.2.5 | 318 | 1/22/2024 |
| 2.2.4 | 183 | 1/22/2024 |
| 2.2.3 | 714 | 11/22/2023 |
| 2.2.2 | 704 | 11/20/2023 |
| 2.2.1 | 208 | 11/20/2023 |
| 2.2.0 | 312 | 11/20/2023 |
| 2.1.3 | 1,887 | 8/18/2023 |
| 2.1.2 | 1,192 | 7/10/2023 |
| 2.1.1 | 2,024 | 4/3/2023 |
| 2.1.0 | 1,661 | 3/14/2023 |
| 2.0.10 | 4,737 | 1/9/2023 |
| 2.0.9 | 1,385 | 12/22/2022 |
| 2.0.8 | 552 | 12/22/2022 |
| 2.0.7 | 426 | 12/22/2022 |
| 2.0.6 | 1,342 | 11/21/2022 |
| 2.0.5 | 1,629 | 11/19/2022 |
| 2.0.4 | 1,071 | 11/19/2022 |
| 2.0.3 | 749 | 11/19/2022 |
| 2.0.2 | 406 | 11/19/2022 |
| 2.0.1 | 553 | 11/19/2022 |
| 2.0.0 | 433 | 11/19/2022 |
| 1.2.15 | 1,763 | 9/27/2022 |
| 1.2.14 | 540 | 9/27/2022 |
| 1.2.13 | 529 | 9/27/2022 |
| 1.2.12 | 1,445 | 9/26/2022 |
| 1.2.11 | 577 | 9/26/2022 |
| 1.2.10 | 1,299 | 9/24/2022 |
| 1.2.9 | 927 | 9/24/2022 |
| 1.2.8 | 812 | 9/24/2022 |
| 1.2.7 | 507 | 9/24/2022 |
| 1.2.6 | 799 | 9/24/2022 |
| 1.2.5 | 551 | 9/24/2022 |
| 1.2.4 | 539 | 9/24/2022 |
| 1.2.3 | 568 | 9/24/2022 |
| 1.2.2 | 625 | 9/24/2022 |
| 1.2.1 | 540 | 9/24/2022 |
| 1.2.0 | 543 | 9/24/2022 |
| 1.1.16 | 556 | 9/24/2022 |
| 1.1.15 | 541 | 9/24/2022 |
| 1.1.14 | 542 | 9/24/2022 |
| 1.1.13 | 543 | 9/24/2022 |
| 1.1.12 | 531 | 9/24/2022 |
| 1.1.11 | 540 | 9/24/2022 |
| 1.1.10 | 1,862 | 9/19/2022 |
| 1.1.9 | 1,403 | 9/19/2022 |
| 1.1.8 | 1,314 | 9/19/2022 |
| 1.1.7 | 577 | 9/19/2022 |
| 1.1.6 | 1,279 | 9/19/2022 |
| 1.1.5 | 552 | 9/19/2022 |
| 1.1.4 | 557 | 9/19/2022 |
| 1.1.3 | 543 | 9/19/2022 |
| 1.1.2 | 560 | 9/19/2022 |
| 1.1.1 | 528 | 9/17/2022 |
| 1.1.0 | 534 | 9/17/2022 |
| 1.0.0 | 7,633 | 8/24/2022 |