Пример #1
0
        public ActionResult Following()
        {
            var userId  = User.Identity.GetUserId();
            var artists = _context.Followings
                          .Where(f => f.FollowerId == userId)
                          .Select(a => a.Followee);

            var viewModel = new ArtistViewModel()
            {
                FollowingArtist = artists
            };

            return(View(viewModel));
        }
Пример #2
0
        public ActionResult Following()
        {
            var userId = User.Identity.GetUserId();
            var artist = context.Followings
                         .Where(a => a.FollowerId == userId)
                         .Select(a => a.Followee.Name)

                         .ToList();

            var viewModel = new ArtistViewModel
            {
                FollowingArtists = artist,
                ShowActions      = User.Identity.IsAuthenticated,
                Heading          = "Artist I'm Following"
            };

            return(View(viewModel));
        }
Пример #3
0
        public ActionResult Following()
        {
            var userId = User.Identity.GetUserId();

            var artists = _context.Followings
                          .Where(a => a.FollowerId == userId)
                          .Select(a => a.Followee)
                          .ToList();

            var artistList = new List <ArtistViewModel>();

            foreach (var artist in artists)
            {
                var buffer = new ArtistViewModel
                {
                    ArtistName = artist.Name,
                    ArtistId   = artist.Id
                };
                artistList.Add(buffer);
            }

            return(View(artistList));
        }