public async Task <IActionResult> Get() { var albums = await _albumsRepository.GetAlbums(); if (!albums.Any()) { return(NotFound()); } return(Ok( albums.Select( x => new AlbumResponse( HypermediaLinkBuilder.ForAlbumDiscovery(Url, x.Id, x.UserId), new Dictionary <string, string> { { "id", x.Id.ToString() }, { "userId", x.UserId.ToString() }, { "title", x.Title } })))); }
public async Task <IActionResult> Get() { var albums = await _repo.GetAlbums(); return(Ok(albums)); }