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: 6.0.0+39696a967e8826f7f1ebc8c1ff4523c9dd75abe0
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