public async Task <IViewComponentResult> InvokeAsync(AppData app) { var entries = await _appService.GetPerkStats(app); var vm = new AppTopItemsViewModel { App = app, Entries = entries }; return(View(vm)); }
public IActionResult AppTopItems(string appId) { var app = HttpContext.GetAppData(); if (app == null) { return(NotFound()); } app.StoreData = GetCurrentStore(); var vm = new AppTopItemsViewModel { App = app }; return(ViewComponent("AppTopItems", new { vm })); }
public async Task <IViewComponentResult> InvokeAsync(AppTopItemsViewModel vm) { if (vm.App == null) { throw new ArgumentNullException(nameof(vm.App)); } if (vm.InitialRendering) { return(View(vm)); } var entries = Enum.Parse <AppType>(vm.App.AppType) == AppType.Crowdfund ? await _appService.GetPerkStats(vm.App) : await _appService.GetItemStats(vm.App); vm.Entries = entries.ToList(); return(View(vm)); }