private void OnActionCompleted(object sender, EventArgs e)
{
Async<ActionResult> asyncActionResult = (Async<ActionResult>)sender;
if (asyncActionResult.HasError) {
asyncActionResult.MarkErrorAsHandled();
_asyncResult.Complete(new ErrorActionResult(asyncActionResult.Error));
}
else {
_asyncResult.Complete(asyncActionResult.Result);
}
}