public ActionResult PWG()
        {
            ViewBag.SyncType = "Synchronous";
            var widgetService = new WidgetService();
            var prodService = new ProductService();
            var gizmoService = new GizmoService();

            var pwgVM = new ProdGizWidgetVM(
                widgetService.GetWidgets(),
                prodService.GetProducts(),
                gizmoService.GetGizmos()
               );

            return View("PWG", pwgVM);
        }
        public async Task<ActionResult> PWGasync()
        {
            ViewBag.SyncType = "Asynchronous";
            var widgetService = new WidgetService();
            var prodService = new ProductService();
            var gizmoService = new GizmoService();

            var widgetTask = widgetService.GetWidgetsAsync();
            var prodTask = prodService.GetProductsAsync();
            var gizmoTask = gizmoService.GetGizmosAsync();

            await Task.WhenAll(widgetTask, prodTask, gizmoTask);

            var pwgVM = new ProdGizWidgetVM(
               widgetTask.Result,
               prodTask.Result,
               gizmoTask.Result
               );

            return View("PWG", pwgVM);
        }
 public async Task<ActionResult> GizmosCancelAsync(
                        CancellationToken cancellationToken)
 {
     ViewBag.SyncOrAsync = "Asynchronous";
     var gizmoService = new GizmoService();
     return View("Gizmos",
         await gizmoService.GetGizmosAsync(cancellationToken));
 }
 public ActionResult Gizmos()
 {
     ViewBag.SyncOrAsync = "Synchronous";
     var gizmoService = new GizmoService();
     return View("Gizmos", gizmoService.GetGizmos());
 }
 public async Task<ActionResult> GizmosAsync()
 {
     ViewBag.SyncOrAsync = "Asynchronous";
     var gizmoService = new GizmoService();
     return View("Gizmos", await gizmoService.GetGizmosAsync());
 }