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)); }
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)); }