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

Namespace:  Autofac
Assembly:  Autofac (in Autofac.dll) Version: 6.0.0+39696a967e8826f7f1ebc8c1ff4523c9dd75abe0
public static class ParameterExtensions

The ParameterExtensions type exposes the following members.

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", ""));
Alternatively, the parameters can be provided via a Generated Factory -
See Also