Skip to main content

SymbolExtensions.GetAttribute Method

Containing Type: SymbolExtensions

Assembly: Roslynator.Core.dll

Overloads

MethodSummary
GetAttribute(ISymbol, INamedTypeSymbol)Returns the attribute for the symbol that matches the specified attribute class, or null if the symbol does not have the specified attribute.
GetAttribute(ISymbol, MetadataName)Returns the attribute for the symbol that matches the specified name, or null if the symbol does not have the specified attribute.

GetAttribute(ISymbol, INamedTypeSymbol)

Returns the attribute for the symbol that matches the specified attribute class, or null if the symbol does not have the specified attribute.

public static Microsoft.CodeAnalysis.AttributeData? GetAttribute(this Microsoft.CodeAnalysis.ISymbol symbol, Microsoft.CodeAnalysis.INamedTypeSymbol attributeClass)

Parameters

symbol ISymbol

attributeClass INamedTypeSymbol

Returns

AttributeData

GetAttribute(ISymbol, MetadataName)

Returns the attribute for the symbol that matches the specified name, or null if the symbol does not have the specified attribute.

public static Microsoft.CodeAnalysis.AttributeData? GetAttribute(this Microsoft.CodeAnalysis.ISymbol symbol, in Roslynator.MetadataName attributeName)

Parameters

symbol ISymbol

attributeName MetadataName

Returns

AttributeData