public async Task <IActionResult> GetAllArtists([FromHeader(Name = "x-correlationToken")] string correlationToken) { Guard.ForNullOrEmpty(correlationToken, "correlationToken"); var artists = await _catalogBusinessServices.GetAllArtists(correlationToken); if (artists == null || artists.Count < 1) { return(BadRequest("Genres do not exist")); } return(new ObjectResult(Mapper.MapToArtistDto(artists))); }
public async Task <IActionResult> GetAllArtists(string correlationToken) { Guard.ForNullOrEmpty(correlationToken, "correlationToken"); var artists = await _catalogBusinessServices.GetAllArtists(correlationToken); if (artists.Count < 1) { return(new ObjectResult(new List <ArtistDto>())); } // ObjectResult return type is capable of content negotiation return(new ObjectResult(Mapper.MapToArtistDto(artists))); }