ASP.NET web services - async

From Logic Wiki
Revision as of 14:27, 9 May 2016 by Dt1nh6 (Talk | contribs) (1 revision imported)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


When calling a web service from client asyncroniously put async keyword before method definition and change service call with async version (AddProtein -> AddProteinAsync) also await keyword is preventing screen freezing

async private void OnAddProtein(Object sender, EventArgs e)
{
  var userId = ....
  var newTotal = await service.AddProteinAsync

in older versions, change service reference to "Generate asynchronous operations" and in code apply BeginAddProtein .. callback etc..