public override int Calculate() { if (_creditManager == null) { _creditManager = new CreditManager(); _cachedValue = _creditManager.Calculate(); } return(_cachedValue); }
static void Main(string[] args) { CreditManager manager = new CreditManager(); Console.WriteLine(manager.Calculate()); Console.WriteLine(manager.Calculate()); Console.ReadLine(); }
public override int Calculate() { if (_creditManager == null) //Eğer işlem ilk defa yapılıyorsa { _creditManager = new CreditManager(); _cachedValue = _creditManager.Calculate(); } //İlk defa yapılmıyorsa return(_cachedValue); }
public override int Calculate() { if (creditManager == null) { creditManager = new CreditManager(); cachedValue = creditManager.Calculate(); } return(cachedValue); }
public override int Calculate() { if (_manager != null) { return(_cachedValue); } _manager = new CreditManager(); _cachedValue = _manager.Calculate(); return(_cachedValue); }