コード例 #1
0
        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));
        }
コード例 #2
0
        //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));
        }