public ViewResult Index() { int accountId = Convert.ToInt32(User.Identity.Name.Split('|')[1]); MyCollectionsViewModel model = new MyCollectionsViewModel(); model.MyLikes = _collectionService.getMyLikes(accountId); model.MySaves = _collectionService.GetMySaves(accountId); model.MyCreations = _collectionService.GetMyCreations(accountId); return(View(model)); }
//GET: Collection public async Task <IActionResult> Index(string userName) { User User = await _userManager.FindByNameAsync(userName); List <Collection> AllCollections = _collectionContext.Collections.ToList().OrderBy(i => i.nItems).ToList(); MyCollectionsViewModel model = new MyCollectionsViewModel { User = User, Collections = AllCollections }; return(View(model)); }