Autofac .NET Inversion of Control Container
NamedParameter Class
NamespacesAutofacNamedParameter
A parameter identified by name. When applied to a reflection-based component, Name will be matched against the name of the component's constructor arguments. When applied to a delegate-based component, the parameter can be accessed using Named<(Of <(T>)>)(IEnumerable<(Of <(Parameter>)>), String).
Declaration Syntax
C#Visual BasicVisual C++
public class NamedParameter : ConstantParameter
Public Class NamedParameter _
	Inherits ConstantParameter
public ref class NamedParameter : public ConstantParameter
Members
All MembersConstructorsMethodsProperties



IconMemberDescription
NamedParameter(String, Object)
Create a NamedParameter with the specified constant value.

CanSupplyValue(ParameterInfo, IComponentContext, Func<(Of <(Object>)>)%)
Returns true if the parameter is able to provide a value to a particular site.
(Inherited from ConstantParameter.)
Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Finalize()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetHashCode()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetType()()()
Gets the Type of the current instance.
(Inherited from Object.)
MemberwiseClone()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Name
The name of the parameter.

ToString()()()
Returns a String that represents the current Object.
(Inherited from Object.)
Value
The value of the parameter.
(Inherited from ConstantParameter.)
Examples
Component with parameter:
CopyC#
public class MyComponent
{
    public MyComponent(int amount) { ... }
}
Providing the parameter:
CopyC#
var builder = new ContainerBuilder();
builder.RegisterType<MyComponent>();
var container = builder.Build();
var myComponent = container.Resolve<MyComponent>(new NamedParameter("amount", 123));
Inheritance Hierarchy

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