I have two methods in the WCF service:
Method1()
{
_currentValue = 10;
}
Method2()
{
return _currentValue;
}
I have a situation where I need to set a value in Method1 () and read it in Method2 ().
I tried using a variable staticlike public static int _currentValue, I was able to read the value set in Method1 () in Method2 ().
But the problem is that I want this variable to react as a separate instance variable for each request made. that is right now below is the problem
Browser 1:
- Method1() is called
=> sets _currentValue = 10;
- Method2() is called
=> returns _currentValue = 10;
Browser 2:
- Method2() is called
=> returns _currentValue = 10;
In fact, the set of values - this browser 1 is static, so the same value is retrieved in browser 2.
, , - , ( ). ? ?