C
C#8mo ago
SWEETPONY

✅ how to check attribute name?

I have following:
if (syntaxNode
is RecordDeclarationSyntax
and MemberDeclarationSyntax { AttributeLists.Count: > 0 } member)
{
MemberSyntaxes.Add(member);
}
if (syntaxNode
is RecordDeclarationSyntax
and MemberDeclarationSyntax { AttributeLists.Count: > 0 } member)
{
MemberSyntaxes.Add(member);
}
I want to check if member contains special attribute. How to do it?
2 Replies
SWEETPONY
SWEETPONY8mo ago
I tried this but it looks weird var t= member.AttributeLists.FirstOrDefault().Attributes.FirstOrDefault().Name;
Pobiega
Pobiega8mo ago
#roslyn is the go-to channel for stuff like this they can probably give you the answer of the top of their heads 🙂
Want results from more Discord servers?
Add your server