C
C#9mo 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
SWEETPONYOP9mo ago
I tried this but it looks weird var t= member.AttributeLists.FirstOrDefault().Attributes.FirstOrDefault().Name;
Pobiega
Pobiega9mo 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