public async Task <IActionResult> Delete(int id) { var artist = await _artistRepo.GetByIdAsync(id); if (artist == null) { return(NotFound()); } _artistRepo.Delete(artist); await _artistRepo.SaveChangesAsync(); var mappedArtist = _mapper.Map <ArtistDto>(artist); return(Ok(_linkService.CreateLinksWhenDeleted(mappedArtist))); }
public Artist DeleteArtist(long id) { return(_artistRepo.Delete(id)); }