![]() |
VOOZH | about |
dotnet add package AttributeBasedRegistration.Autofac --version 2.2.0
NuGet\Install-Package AttributeBasedRegistration.Autofac -Version 2.2.0
<PackageReference Include="AttributeBasedRegistration.Autofac" Version="2.2.0" />
<PackageVersion Include="AttributeBasedRegistration.Autofac" Version="2.2.0" />Directory.Packages.props
<PackageReference Include="AttributeBasedRegistration.Autofac" />Project file
paket add AttributeBasedRegistration.Autofac --version 2.2.0
#r "nuget: AttributeBasedRegistration.Autofac, 2.2.0"
#:package AttributeBasedRegistration.Autofac@2.2.0
#addin nuget:?package=AttributeBasedRegistration.Autofac&version=2.2.0Install as a Cake Addin
#tool nuget:?package=AttributeBasedRegistration.Autofac&version=2.2.0Install as a Cake Tool
Library allowing registering services with Autofac and Microsoft's DI container via attributes. Additionally contains various extensions to Autofac and Microsoft's DI container.
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 pick up and register services via attributes use the extensions method on ContainerBuilder or IServiceCollection provided by the library:
builder.AddAttributeDefinedServices(assembliesToScan);
Documentation available at https://attribute-registration.mikym.me/.
public interface ICustomService1
{
}
[ServiceImplementation]
[RegisterAs(typeof(ICustomService))]
[Lifetime(ServiceLifetime.InstancePerLifetimeScope)]
[DecoratedBy(1, typeof(ISomeDecorator))]
[EnableInterception(InterceptionStrategy.Interface)]
[InterceptedBy(1, typeof(ISomeInterceptor))]
public class CustomService1 : ICustomService1
{
}
public interface ICustomService2
{
}
[ServiceImplementation(ServiceLifetime.SingleInstance, RegistrationStrategy.AsConventionNamedInterface)]
public class CustomService2 : ICustomService2
{
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. 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 was computed. 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 4 NuGet packages that depend on AttributeBasedRegistration.Autofac:
| Package | Downloads |
|---|---|
|
ResultCQRS.Autofac
Library featuring CQRS pattern. |
|
|
ResultCommander.Autofac
Library featuring a command handler pattern. |
|
|
DataExplorer.Unstable
Library featuring common patterns in regard to working with data storages. |
|
|
DataExplorer.Extensions.Autofac
Library providing Autofac integration for DataExplorer. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.3.0 | 403 | 5/23/2025 |
| 2.2.7 | 451 | 7/23/2024 |
| 2.2.6 | 682 | 1/24/2024 |
| 2.2.5 | 331 | 1/22/2024 |
| 2.2.4 | 235 | 1/22/2024 |
| 2.2.3 | 703 | 11/22/2023 |
| 2.2.2 | 637 | 11/20/2023 |
| 2.2.1 | 201 | 11/20/2023 |
| 2.2.0 | 288 | 11/20/2023 |
| 2.1.5 | 1,804 | 8/18/2023 |
| 2.1.4 | 1,104 | 7/10/2023 |
| 2.1.3 | 647 | 6/25/2023 |
| 2.1.2 | 985 | 5/10/2023 |
| 2.1.1 | 1,095 | 4/3/2023 |
| 2.1.0 | 1,467 | 3/14/2023 |
| 2.0.10 | 4,666 | 1/9/2023 |
| 2.0.9 | 1,326 | 12/22/2022 |
| 2.0.8 | 428 | 12/22/2022 |