[Solved] Visual Studio said my variables are useless in a private method [closed]


Because these parameters are not being passed by reference, setting them to any value will only change the value of the parameter variables local to your helper method: it will not impact the values that were passed in to those parameters.

Since you don’t use the new values you’re assigning to those parameters inside the method, Visual Studio is smart enough to recognize that setting values to them has no effect. It’s warning you about that, which is good because in this case you might think your code is doing something that it’s not really doing.

3

solved Visual Studio said my variables are useless in a private method [closed]