开发者

How to handle many related wcf-calls in Silverlight 4

开发者 https://www.devze.com 2023-04-05 08:46 出处:网络
i try to become a good friend with the asynchronous nature of WCF calls in Silverlight. Often i read \"you have to understand asynchronous programming\" and i think i have understand the idee and the

i try to become a good friend with the asynchronous nature of WCF calls in Silverlight. Often i read "you have to understand asynchronous programming" and i think i have understand the idee and the benefits. But how can i handle processes which are naturally synchron with WCF calls, which are naturally asynchron. For example, load an entry from an online database, edit the entry, save it, do something, load it again, edit it again开发者_StackOverflow, save it. If it do that with the Microsoft Pattern i get an infinite loop.

public foo()
{
    LoadEntryAsync()
}

LoadEntryCompleted(Entry entry)
{
    entry.counter += 1;
    UpdateEntryAsync(entry);
}


UpdateEntryCompleted(Entry entry)
{
    //do something
    LoadEntryAsync();
}

Can anybody help me?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号