C
C#15mo 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; }
[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?
1 Reply
SWEETPONY
SWEETPONYOP15mo ago
public bool UseDC1 { get; set; }
public bool UseDC2 { get; set; }
public bool UseDC1 { get; set; }
public bool UseDC2 { get; set; }
hm it works I don't know why but nameof didn't work before 🤡 thanks
Want results from more Discord servers?
Add your server