Ejemplo n.º 1
0
        public async Task <IActionResult> DeteteAsync(string id)
        {
            var artist = await _artistService.GetAsync(new ObjectId(id));

            if (artist == null)
            {
                return(NotFound());
            }
            await _artistService.DeleteAsync(new ObjectId(id));

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> DeleteAsync(int id)
        {
            var result = await _artistService.DeleteAsync(id);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }

            var artistDTO = _mapper.Map <Artist, ArtistDTO>(result.Artist);

            return(Ok(artistDTO));
        }