Hi all,
I am passing one parameter/object to the function "RefValTest(object oIn)" by the value but after function call is over object passed by the value is changed, that shoud not happened, right ?
class MilanTest
{
public int SomeValue { get; set; }
}
class PR
{
public static object RefValTest(object oIn)
{
PropertyInfo tProperty = oIn.GetType().GetProperty("SomeValue");
tProperty.SetValue(oIn, 5, null);
return null;
}
}
somewhere in the main:
MilanTest x = new MilanTest ();
//here is by compiler default x.Somevalue == 0
PR.RefValTest(x);
//here is by compiler default x.Somevalue == 5
How it is possible that after call of "PR.RefValTest(x)" value of object x.SomeValue is changed ?
Br, Milan.