示例#1
0
        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)));
        }
示例#2
0
 public Artist DeleteArtist(long id)
 {
     return(_artistRepo.Delete(id));
 }