C#C
C#3y ago
SWEETPONY

✅ Is it possible to use nameof in attributes?

I have this:
[UIGroup]                               
public DCSettings DC { get; set; }      
                                        
[UIGroup]                               
[Effect(                                
    source: "DC.UseDC1, DC.UseDC2",     
    values: "[true]",                   
    what: "enable")]                    
public GuardSettings Guard { get; set; }


I don't like writing the name of properties using "" because name can be changed
So is it possible to write the same but with nameof?
Was this page helpful?