public async Task <IActionResult> GetAlbumById([FromRoute] int id) { var album = _albumsRepo.GetEntityById(id); var model = AlbumViewModel.FromAlbum(album); return(Ok(model)); }
public async Task <IActionResult> GetMostPopularAlbums() { var toprated = _albumsRepo.GetTopRated(); var model = toprated.Select(a => AlbumViewModel.FromAlbum(a)); return(Ok(model)); }
public async Task <IActionResult> GetAllAlbums() { var albums = _albumsRepo.GetAllEntities(); var model = albums.Select(a => AlbumViewModel.FromAlbum(a)); return(Ok(model)); }
public IEnumerable <AlbumViewModel> SearchBand([FromQuery] string search, [FromQuery] bool?hasMorethenSixMembers) { return(_albumsRepo.SearchEntity(search, hasMorethenSixMembers).Select(a => AlbumViewModel.FromAlbum(a))); }