Click or drag to resize

InjectAttribute Constructor (Object)

Initializes a new instance of InjectAttribute

Namespace:  Cauldron.Activator
Assembly:  Cauldron.Activator (in Cauldron.Activator.dll) Version: 3.2.0.1 (3.2.0.1)
Syntax
C#
public InjectAttribute(
	params 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