ASP.NET web services - async

From Logic Wiki
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..