I have the following setup in an aspx page:
Object Original = obj;
System.Threading.Thread thread = new System.Threading.Thread(() => saveOriginalDetails(Original));
thread.Start();
The basic idea of this is that I have an object, and I want to save it exactly how it is before making any changes to it.
So I make a copy of the original object obj
and store it as Original
I am starting a new thread because the saveOriginalDetails
method is slowing the code down too much.
My question is, if I do this instead:
System.Threading.Thread thread = new System.Threading.Thread(() => saveOriginalDetails(obj));
thread.Start();
obj.name = "NewName";
Where I am now passing in the original object, and copy it inside the method that is running concurrently, like this:
private void saveOriginalDetails(object applicant)
{
object OriginalApplicant = applicant;
.....
}
Will the object passed in to the method:
saveOriginalDetails(obj));
Have the updated name value eg a name of newName
?