Click or drag to resize

ParameterExtensions Class

Extension methods that simplify extraction of parameter values from an IEnumerableT where T is Parameter. Each method returns the first matching parameter value, or throws an exception if none is provided.
Inheritance Hierarchy
SystemObject
  AutofacParameterExtensions

Namespace:  Autofac
Assembly:  Autofac (in Autofac.dll) Version: 4.9.1+831973f4d02fbc619921dfaa8ac0c536f60ae7a3
Syntax
public static class ParameterExtensions

The ParameterExtensions type exposes the following members.

Methods
Examples
At configuration time, delegate registrations can retrieve parameter values using the methods NamedT(IEnumerableParameter, String), PositionalT(IEnumerableParameter, Int32) and TypedAsT(IEnumerableParameter):
builder.Register((c, p) => new FtpClient(p.Named<string>("server")));
These parameters can be provided at resolution time:
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.
See Also