Skip to content

Instantly share code, notes, and snippets.

@HEskandari
Created September 29, 2011 19:50
Show Gist options
  • Save HEskandari/1251743 to your computer and use it in GitHub Desktop.
Save HEskandari/1251743 to your computer and use it in GitHub Desktop.
Async Abstraction Usage
public IEnumerable<IResult> LoadReport(int reportId)
{
yield return Display.Busy();
var service = new ReportingServiceClient();
yield return Display.ChangeStatus("Preparing Reports...");
yield return new WebServiceResult().Invoke(service.PrepareReports);
ReportInfo report = null;
yield return new WebServiceResult().InvokeWithParam(service.GetReportInfoAsync, reportId).WhenCompleted(result => result.ResultAs<ReportInfo>());
yield return new ActionResult(() => DisplayReport(report));
yield return Display.NotBusy();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment