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.
| C# | Visual Basic | Visual C++ |
public static class ParameterExtensions
Public NotInheritable Class ParameterExtensions
public ref class ParameterExtensions abstract sealed
| All Members | Methods | ||||
| Icon | Member | Description |
|---|---|---|
| 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.
|
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#
These parameters can be provided at resolution time:
CopyC#
Alternatively, the parameters can be provided via a Generated Factory - http://code.google.com/p/autofac/wiki/DelegateFactories.
builder.Register((c, p) => new FtpClient(p.Named<string>("server")));
container.Resolve<FtpClient>(new NamedParameter("server", "ftp.example.com"));
| Object | |
| ParameterExtensions | |