-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow usage of nameof on parameters of methods from outside #771
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following method:
Now I would love to use nameof onto a parameter from outside the method.
I propose the following syntax.
If this is not clear enough, another idea would be
ClassName.MethodName.params.paramName
So the
params
keyword to access the params of a method.Where is this useful?
This would be especially useful in Web/using ASP.NET when you have to specify the name of a parameter of a method as a string. With this change I would be able to adress them in a compile time and refoctoring safe way. If the param name changes, I'll notice.
The text was updated successfully, but these errors were encountered: