RequireAspect<TAspect>(IQuery<IDeclaration>)
Requires an instance of a specified aspect type to be present on a specified declaration. If the aspect is not present, this method adds a new instance of the aspect by using the default aspect constructor.
Declaration
public static void RequireAspect<TAspect>(this IQuery<IDeclaration> query) where TAspect : class, IAspect, new()Parameters
| Type | Name | Description |
|---|---|---|
| IQuery<IDeclaration> | query |
Type Parameters
| Name | Description |
|---|---|
| TAspect | Type of the aspect. The type must be ordered after the aspect type calling this method. |
Remarks
Calling this method causes the current aspect to be present in the Predecessors list even if the required aspect was already present on the target declaration.