public void GetSpeakersAsync() { var speakerDataProvider = new SpeakerDataProvider(); AsyncManager.OutstandingOperations.Increment(); speakerDataProvider.GetSpeakers().ContinueWith(d => { AsyncManager.Parameters["speakers"] = d.Result; AsyncManager.OutstandingOperations.Decrement(); }); }
public async Task<ActionResult> GetSpeakers() { var speakerDataProvider = new SpeakerDataProvider(); var speakers = await speakerDataProvider.GetSpeakers(); return Json(new { Result = speakers }, JsonRequestBehavior.AllowGet); }