public async Task <JsonResult> TesAsync3() { pwgVM vm = await pwgService.RunTaskGetAll(); var result = new JsonResult(); result.Data = vm; result.JsonRequestBehavior = JsonRequestBehavior.AllowGet; return(result); }
public static async Task <pwgVM> RunTaskGetAll() { var task1 = TaskGetItem <Product>(); var task2 = TaskGetItem <Gizmos>(); var task3 = TaskGetItem <Widget>(); await Task.WhenAll(task1, task2, task3); pwgVM vm = new pwgVM(task1.Result, task2.Result, task3.Result); return(vm); }
//async public async Task <ActionResult> PWGAsync() { pwgVM vm = await pwgService.RunTaskGetAll(); return(View(vm)); }