Open sandboxFocus

Method Advice

Advice(object, RelationshipInfo, bool)

Injects the Aggregatable dynamic implementation 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 implementation 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 if obj cannot be dynamically advised, otherwise false.

Returns
Type Description
bool

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

Advice(object, RelationshipKind, bool)

Injects the Aggregatable dynamic implementation 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 implementation 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 if obj cannot be dynamically advised, otherwise false.

Returns
Type Description
bool

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