Beispiel #1
0
        public HttpResponse All()
        {
            if (!this.IsUserLoggedIn())
            {
                return(this.Redirect("/Users/Login"));
            }

            var viewModel = new AlbumAllViewModel
            {
                Albums = this.albumsService.GetAllAlbums(x => new AlbumInfoViewModel
                {
                    Id   = x.Id,
                    Name = x.Name
                })
            };

            return(this.View(viewModel));
        }
Beispiel #2
0
        public HttpResponse All()
        {
            if (!this.IsUserLoggedIn())
            {
                return(this.Redirect("/Users/Login"));
            }

            var albumAllViewModel = new AlbumAllViewModel
            {
                Albums = this.albumService
                         .GetAllAlbums()
                         .Select(a => new AlbumInfoViewModel
                {
                    Id   = a.Id,
                    Name = a.Name
                })
                         .ToList()
            };

            return(this.View(albumAllViewModel));
        }