Nameless.Autofac 3.4.2

dotnet add package Nameless.Autofac --version 3.4.2
                    
NuGet\Install-Package Nameless.Autofac -Version 3.4.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nameless.Autofac" Version="3.4.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nameless.Autofac" Version="3.4.2" />
                    
Directory.Packages.props
<PackageReference Include="Nameless.Autofac" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nameless.Autofac --version 3.4.2
                    
#r "nuget: Nameless.Autofac, 3.4.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nameless.Autofac@3.4.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nameless.Autofac&version=3.4.2
                    
Install as a Cake Addin
#tool nuget:?package=Nameless.Autofac&version=3.4.2
                    
Install as a Cake Tool

Nameless Autofac Library

This library provides a set of extensions and utilities for the Autofac dependencyty injection framework.

Content

<a name="property-resolve-middleware"></a>

Property Resolve Middleware

Register the middleware in your Autofac container to enable property injection, when constrting components. This is useful for scenarios where you want to inject properties into components that are not directly registered in the container or when injection through constructor is not available.

How to Use

var builder = new ContainerBuilder();

builder.RegisterType<ClassWithPropertyToInject>()
       .ConfigurePipeline(configure => {
           var propertyType = typeof(IServiceToInject);
           var resolver = (MemberInfo _, IComponentContext ctx) => ctx.Resolve<IServiceToInject>();
           
           configure.Use(new PropertyResolveMiddleware(propertyType, resolver));
       });

<a name="service-provider-extensions"></a>

Service Provider Extensions

<a name="component-context-extensions"></a>

Component Context Extensions

ModuleBase: This abstract class should be used when you want to create an Autofac.Module.

Methods:

  • GetImplementation<TService>: Retrieves, from support assemblies, a single implementation from the given service type.
  • GetImplementation(Type serviceType): Non-generic version of GetImplementation<TService>.
  • GetImplementations<TService>: Retrieves, from support assemblies, all implementations from the given service type.
  • GetImplementations(Type serviceType): Non-generic version of GetImplementations<TService>.

Note: All those methods searches for implementations that are:

  • Exportable types
  • Non-Interface
  • Non-Abstract
  • Should be assignable from (or generic) the given type.

PropertyResolveMiddleware: Useful to inject properties, using a factory.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.4.2 41 8/23/2025
3.4.1 124 8/17/2025
3.4.0 99 8/17/2025
3.3.5 145 2/20/2025