Open sandboxFocus

Method RequireAspect

RequireAspect<TAspect>(IAdviser)

Adds an aspect to the target declaration, unless there is already an aspect of that type on the declaration. Use the With<TNewDeclaration>(TNewDeclaration) method to add the aspect to a different declaration than the current one.

Declaration
public static void RequireAspect<TAspect>(this IAdviser adviser) where TAspect : class, IAspect, new()
Parameters
Type Name Description
IAdviser adviser

An adviser for a declaration.

Type Parameters
Name Description
TAspect

The aspect type. It must have a default constructor.

RequireAspect(IAdviser, Type)

Adds an aspect to the target declaration, unless there is already an aspect of that type on the declaration. Use the With<TNewDeclaration>(TNewDeclaration) method to add the aspect to a different declaration than the current one.

Declaration
public static void RequireAspect(this IAdviser adviser, Type aspectType)
Parameters
Type Name Description
IAdviser adviser

An adviser for a declaration.

Type aspectType

The aspect type. It must have a default constructor.