| InjectAttribute Constructor (Object) |
Namespace:
Cauldron.Activator
Assembly:
Cauldron.Activator (in Cauldron.Activator.dll) Version: 3.2.0.2
Syntax public InjectAttribute(
params Object[] arguments
)
Public Sub New (
ParamArray arguments As Object()
)
public:
InjectAttribute(
... array<Object^>^ arguments
)
Parameters
- arguments
- Type: SystemObject
The The arguments that can be used to initialize the instance.
The arguments also supports referencing to a property or field. The property or field name has to be prefixed with [property] or [field]. Passing [this] will weave a "this" reference to the parameters.
Examples
An example on passing a property's value to an injection.
public string Name { get; set; }
[Inject("[this]", "[property] Name")]
public IShop Shop { get; }
An example on passing a field's value to an injection.
private string name;
[Inject("[this]", "[field] name")]
public IShop Shop { get; }
See Also