Open sandboxFocus

Method ApplyAspect

ApplyAspect<T>(T, IAspect<T>, string?)

Creates a CodeFix that applies a given aspect to a given declaration, so that the source code itself is modified by the aspect.

Declaration
public static CodeFix ApplyAspect<T>(T targetDeclaration, IAspect<T> aspect, string? title = null) where T : class, IDeclaration
Parameters
Type Name Description
T targetDeclaration

The declaration to which the aspect must be applied.

IAspect<T> aspect

The aspect that must be applied to the declaration.

string title

An optional title of the CodeFix, displayed to the user in the light bulb or refactoring menu. When not specified, the title is generated from the other parameters.

Returns
Type Description
CodeFix
Type Parameters
Name Description
T