4 ms·
Lazy<T> is quite useful for lazy-loading/memoization.
by bruceboughton 13y ago
Lazy<T> is quite useful for lazy-loading/memoization.
- lukasLansky 13y ago... and writing your own Lazy<T> with time- or otherwise-limited cache validity is not a problem, also.
- gambler 13y agoYes, but cleaner syntax for it would be nice. Right now it looks quite messy: private Lazy<string> _someVariable =new Lazy<string>(SomeClass.IOnlyWantToCallYouOnce); public string SomeVariable { get { return _someVariable.Value; } } Imagine the same things with a long lambda inside.