Open sandboxFocus

Method Advice

Advice(object, RelationshipInfo, bool)

Injects the Aggregatable dynamic impl into an object and specifies the RelationshipInfo.

Declaration
public static bool Advice(object obj, RelationshipInfo relationshipInfo, bool required = true)
Parameters
Type Name Description
object obj

The object into which the impl must be injected.

RelationshipInfo relationshipInfo

The description of the relationship of obj relatively to its parent.

bool required

true if an InvalidOperationException should be thrown in case obj cannot be dynamically advised, otherwise false.

Returns
Type Description
bool

true if the Aggregatable impl was successfully injected into obj, false if obj already implemented the impl, or if obj cannot be dynamically advised and required is false.

Advice(object, RelationshipKind, bool)

Injects the Aggregatable dynamic impl into an object and specifies the RelationshipKind.

Declaration
public static bool Advice(object obj, RelationshipKind itemsRelationship, bool required = true)
Parameters
Type Name Description
object obj

The object into which the impl must be injected.

RelationshipKind itemsRelationship

The description of the relationship of obj relatively to its parent.

bool required

true if an InvalidOperationException should be thrown in case obj cannot be dynamically advised, otherwise false.

Returns
Type Description
bool

true if the Aggregatable impl was successfully injected into obj, false if obj already implemented the impl, or if obj cannot be dynamically advised and required is false.