So what I am trying to do is quite simple.
I am trying to run a nameof()
on some of the primitive types as I need these constants for a certain requirement.
But when I try to do that for eg nameof(bool)
it says that nameof()
does not exist in the current context.
And this seems to be the case with all Synonyms?
Is there any other way to do this or am I missing something.
what I am trying to do is
public static readonly string BoolConstant= nameof(bool);
Expected result:
BoolConstant= "bool";
Will I have to write all these constants down?