MetalamaAPI documentationAspect APIMetalama.​Framework.​Code­FixesCode­Fix­FactoryApply­Aspect
Open sandboxFocus

CodeFixFactory.ApplyAspect Method

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.

System.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