PostSharp.ILAPI ReferencePost­Sharp.​Patterns.​ModelAggregatable­ServicesAdvice
Open sandboxFocus

AggregatableServices.Advice Method

Advice(Object, RelationshipInfo, Boolean)

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.

System.Boolean required

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

Returns
Type Description
System.Boolean

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, Boolean)

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.

System.Boolean required

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

Returns
Type Description
System.Boolean

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.