Replies: 1 comment 1 reply
-
This proposes a language change, so moving to csharplang. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm frequently working with dependency injection tools, reflection, ... and for one way to inject a specific value for a parameters is through the argument name.
Example :
service.Resolve<IService>(NameArg.Create("parentId", parent.Id));
Actually if some dev change the parameter name "parentId" it will cause a bug.
It could be useful to use the power of nameof().
for example nameof(ServiceImpl.ctor(Guid parentId, ...)) it will return at compile time a string "parentId"
OR fix a variable name from a constant, may be through attribute like :
Beta Was this translation helpful? Give feedback.
All reactions