public async Task <List <ArtistJson> > GetArtists() { _logger.LogDebug("GetArtists"); var artists = await DbContext.Artists.ToListAsync(); return(ArtistJson.From(artists)); }
public async Task <IActionResult> GetArtist( [FromQuery] int id) { Artist artist = await DbContext.Artists .Where(a => a.ArtistId == id) .FirstOrDefaultAsync(); if (artist == null) { return(NotFound()); } var result = ArtistJson.From(artist); return(new ObjectResult(result)); }
public async Task <List <ArtistJson> > GetArtists() { var artists = await DbContext.Artists.ToListAsync(); return(ArtistJson.From(artists)); }