Metalama 1.0 / / Metalama Documentation / Aspect API / Metalama.​Framework.​Code­Fixes / Code­Fix­Factory / Remove­Attributes

Method RemoveAttributes

RemoveAttributes(IDeclaration, Type, String)

Creates a CodeFix that removes all custom attributes of a given type from a declaration and all container declarations, by specifying the reflection Type of the attribute.

Declaration
public static CodeFix RemoveAttributes(IDeclaration targetDeclaration, Type attributeType, string title = null)
Parameters
Type Name Description
IDeclaration targetDeclaration

The declaration from which the attribute must be removed.

Type attributeType

The type of the attribute.

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

RemoveAttributes(IDeclaration, INamedType, String)

Creates a CodeFix that removes all custom attributes of a given type from a declaration and all container declarations, by specifying the INamedType of the attribute.

Declaration
public static CodeFix RemoveAttributes(IDeclaration targetDeclaration, INamedType attributeType, string title = null)
Parameters
Type Name Description
IDeclaration targetDeclaration

The declaration from which the attribute must be removed.

INamedType attributeType

The type of the attribute.

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