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. |
RequireAspect<TAspect>(ITypeAmender)
Adds an aspect to the target type, unless there is already an aspect of that type on the declaration.
Declaration
public static void RequireAspect<TAspect>(this ITypeAmender amender) where TAspect : class, IAspect, new()Parameters
| Type | Name | Description |
|---|---|---|
| ITypeAmender | amender | The type amender. |
Type Parameters
| Name | Description |
|---|---|
| TAspect | The aspect type. It must have a default constructor. |
Remarks
This overload resolves the ambiguity between RequireAspect<TAspect>(IAdviser) and AspectQueryExtensions.RequireAspect
for ITypeAmender, which implements both IAdviser and IQuery.