Autofac .NET Inversion of Control Container
ParameterExtensions Class
NamespacesAutofacParameterExtensions
Extension methods that simplify extraction of parameter values from an IEnumerable<(Of <(T>)>) where T is Parameter. Each method returns the first matching parameter value, or throws an exception if none is provided.
Declaration Syntax
C#Visual BasicVisual C++
public static class ParameterExtensions
Public NotInheritable Class ParameterExtensions
public ref class ParameterExtensions abstract sealed
Members
All MembersMethods



IconMemberDescription
Named<(Of <(T>)>)(IEnumerable<(Of <(Parameter>)>), String)
Retrieve a named parameter value from a NamedParameter instance.

Positional<(Of <(T>)>)(IEnumerable<(Of <(Parameter>)>), Int32)
Retrieve a positional parameter value from a PositionalParameter instance.

TypedAs<(Of <(T>)>)(IEnumerable<(Of <(Parameter>)>))
Retrieve a typed parameter value from a TypedParameter instance.

Examples
At configuration time, delegate registrations can retrieve parameter values using the methods Named<(Of <(T>)>)(IEnumerable<(Of <(Parameter>)>), String), Positional<(Of <(T>)>)(IEnumerable<(Of <(Parameter>)>), Int32) and TypedAs<(Of <(T>)>)(IEnumerable<(Of <(Parameter>)>)):
CopyC#
builder.Register((c, p) => new FtpClient(p.Named<string>("server")));
These parameters can be provided at resolution time:
CopyC#
container.Resolve<FtpClient>(new NamedParameter("server", "ftp.example.com"));
Alternatively, the parameters can be provided via a Generated Factory - http://code.google.com/p/autofac/wiki/DelegateFactories.
Inheritance Hierarchy
Object
ParameterExtensions

Assembly: Autofac (Module: Autofac) Version: 2.1.13.813 (2.1.13.813)