This project has moved and is read-only. For the latest updates, please go here.

Correct way to check for existance of data

Apr 12, 2011 at 4:55 AM
Edited Apr 12, 2011 at 5:14 AM

Just curious what is the quickest most appropriate/safest way to check if no data has ever been loaded?  I have a single object I want to cache which I set the key True as per the QuickStart

I came up with the following:

var localCache = (EpmManager.LocalCacheDatabase.Query<EpmCacheLookupData, bool>().Where(c => c.Key)).First();
if (localCache.LazyValue.IsValueCreated) LoadCacheFromServer(); else return localCache.LazyValue.Value;