nameof

The C# operator that turns a symbol into its name as a string, as in nameof(price) giving "price".

In more detail

It is evaluated at compile time, so it costs nothing at run time. Because the compiler checks it, renaming the parameter renames the string too, unlike a hand-typed literal.

Related terms

Taught in

References