C
C#15mo ago
SWEETPONY

❔ It it possible to get name of attribute without reflection?

I have following:
public class Book
{
[CustomAttribute]
public string Name
{
get; private set;
}
}
public class Book
{
[CustomAttribute]
public string Name
{
get; private set;
}
}
is it possible to get the name of CustomAttribute? with type.GetCustomAttribute?
2 Replies
Angius
Angius15mo ago
typeof(CustomAttribute).Name maybe? Besides that, no, attributes are made to be used with reflections and sourcegen
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server