New Posts New Posts RSS Feed: Update from cache
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Update from cache

 Post Reply Post Reply
Author
adamh View Drop Down
Newbie
Newbie


Joined: 07-Jun-2010
Location: New Zealand
Posts: 4
Post Options Post Options   Quote adamh Quote  Post ReplyReply Direct Link To This Post Topic: Update from cache
    Posted: 19-Jul-2010 at 6:21pm
In Silverlight how do a get a single entity in the cache to refresh from value on webserver
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 20-Jul-2010 at 3:00pm
Updating the cache is a pure client-side operation.  It is essentially the same whether you are running a Silverlight, WPF, or WinClient application.  Get the value from webserver and stuff it in the cache.  You should be able to find some examples in the Learning Resources on Disconnected Use,
Back to Top
adamh View Drop Down
Newbie
Newbie


Joined: 07-Jun-2010
Location: New Zealand
Posts: 4
Post Options Post Options   Quote adamh Quote  Post ReplyReply Direct Link To This Post Posted: 20-Jul-2010 at 4:30pm

If I have an instance of an entity Person called ‘person’ on the Silverlight side .. how do I ask it to refresh itself now.

Just that instance.

 

Can't figure it out from the documentation. 

 

Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 20-Jul-2010 at 5:19pm
This is not as obvious as it should be.  We will be reviewing the signatures for RefetchEntitiesAsync.  In the meantime, the code should look like this:
 
      var list = new EntityKeyList(typeof(Person), new EntityKey[] { somePerson.EntityAspect.EntityKey });
      entityManager.RefetchEntitiesAsync(list, MergeStrategy.OverwriteChanges, RefetchCompleted, null);
 
...
 
    void RefetchCompleted(EntityQueryOperation e) {
      // Do stuff
    }
 
Back to Top
adamh View Drop Down
Newbie
Newbie


Joined: 07-Jun-2010
Location: New Zealand
Posts: 4
Post Options Post Options   Quote adamh Quote  Post ReplyReply Direct Link To This Post Posted: 20-Jul-2010 at 5:28pm

lol .. I thought it wasn't straightforward ...

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down