So I have this mock extension method which change a value to another value:
public static void ChangeValue(this int value, int valueToChange)
{
value = value
Because int
is value type, so it copied by value when you pass it inside a function.
To see the changes outside of the function rewrite it like:
public static int ChangeValue(this int value, int valueToChange)
{
//DO SOMETHING ;
return _value_; //RETURN COMPUTED VALUE
}
It would be possible to do using ref keyowrd, but it can not be applied on parameter with this
, so in your case, just return resulting value.