AggregatableServices.Advice Method (Object, RelationshipKind, Boolean) |
Injects the Aggregatable dynamic impl into an object and specifies the RelationshipKind.
Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Aggregation (in PostSharp.Patterns.Aggregation.dll) Version: 2023.0.3.0 (2023.0.3.0)
C#
public static bool Advice( Object obj, RelationshipKind itemsRelationship, bool required = true )
Parameters
- obj
- Type: System.Object
The object into which the impl must be injected. - itemsRelationship
- Type: PostSharp.Patterns.Model.RelationshipKind
The description of the relationship of obj relatively to its parent. - required (Optional)
- Type: System.Boolean
true if an InvalidOperationException should be thrown in case obj cannot be dynamically advised, otherwise false.
Return Value
Type: Booleantrue 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.