AttributeData.
The Problem
Extracting attribute values requires verbose loops and null checks:The Solution
Constructor Arguments
Extract positional arguments from attribute constructors:Named Arguments
Extract named property/field arguments:Symbol Convenience Methods
Get attribute values directly from symbols:Array Arguments
Extract array-typed arguments:Common Patterns
Get Display Name
Get JSON Derived Types
API Reference
| Method | Description |
|---|---|
GetConstructorArgument<T>(index) | Gets constructor argument at index |
TryGetConstructorArgument<T>(index, out value) | Try-pattern for constructor argument |
GetConstructorArgumentCount() | Returns number of constructor arguments |
GetNamedArgument<T>(name) | Gets named argument by name |
TryGetNamedArgument<T>(name, out value) | Try-pattern for named argument |
HasNamedArgument(name) | Checks if named argument exists |
GetNamedArgumentNames() | Enumerates all named argument names |
GetConstructorArgumentArray<T>(index) | Gets array constructor argument |
GetNamedArgumentArray<T>(name) | Gets array named argument |
GetAttributeConstructorArgument<T>(symbol, attrName, index) | Gets constructor arg from symbol’s attribute |
GetAttributeNamedArgument<T>(symbol, attrName, argName) | Gets named arg from symbol’s attribute |
GetDisplayName(symbol) | Gets DisplayAttribute.Name or symbol name |
GetJsonDerivedTypes(type, attrType) | Gets all JsonDerivedType type arguments |
