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

LoadFromCache<> not only loading from cache

Sep 17, 2011 at 11:43 PM

According the the tutorial, "DataManager.LoadFromCache<> works also similarly to Load<>, but it will only load from the cache and is synchronous. This is generally used in app startup as a way to load things up before the UI kicks off, for a example credentials and whatnot. You probably won’t use it often. "

However the behavior I'm seeing when I call LoadFromCache<> is that it behaves the same as Load<> in that if the timeout has been reached on the cached object's cachepolicy (CacheThenRefresh), it kicks off a GetLoadRequest and reloads the data from the source (which in my case a WebLoadRequest to a web service), so not just getting it from the cache.

Am I missing something or this the expected behavior? 

Sep 18, 2011 at 5:59 PM

Sounds like a bug - it's supposed to return null (or a default instance, can't remember which off the top of my head) if the cache isn't there.

Would you be willing to file a bug, with a simple repro or test case if possible, on Issue Tracker and I'll take a look?


Sep 20, 2011 at 11:27 PM

Sure thing.  I'll make up a repro and file a bug.

Sep 21, 2011 at 6:47 AM

Thanks, appreciated.