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
int
is a struct so it's a value-type. this means that they are passed by value not by reference. Classes are reference-types and they act differently they are passed by reference.
Your option is to create static method like this:
public static void ChangeValue(ref int value, int valueToChange)
{
value = valueToChange;
}
and use it:
int a = 10;
ChangeValue(ref a, 15);