Код: Выделить всё
MyStaticClass.MyStaticProperty = "foo";
Task.Run(() =>
{
// Assume this runs for 10 minutes...
// MyStaticClass.MyStaticProperty should continue to be "foo"
// because that's what it was when the task started
});
MyStaticClass.MyStaticProperty = "bar";
// Even though this executes milliseconds after the task starts,
// the value of this property inside the task should remain "foo"
Подробнее здесь: https://stackoverflow.com/questions/792 ... it-was-whe