How do I pass in a class property to a method and have it assigned a value?
For example, below is a simple scenario. The inner workings of the method will be a little more complex.
Action <string> MyMethod = (myString) =>
{
myString = "testing...";
};
and then call it this way
MyMethod (someClass.String1);
MyMethod (someClass.String2);
MyMethod (someClass.String3);
Such that each of the three properties retain an assigned value from the method. As it is, none of the properties will retain a value. They will be null.
I don't want to pass the class in because that means the method will need logic to figure if it is assigning to String1, String2, or String3. I'd like it to remain very generic.