Ejemplo n.º 1
0
        public async Task <Models.Author> DeleteAuthor(int id)
        {
            var result = await _authorRepository.DeleteAuthor(id);

            Models.Author authorModel = _mapper.Map <Models.Author>(result);
            return(authorModel);
        }
Ejemplo n.º 2
0
 public IActionResult Delete(int authorId)
 {
     if (!authorsRepository.AuthorExists(authorId))
     {
         return(NotFound());
     }
     authorsRepository.DeleteAuthor(authorId);
     return(Ok());
 }
Ejemplo n.º 3
0
        public bool DeleteAuthor(int id)
        {
            var authorToDelete = authorsRepository.GetAuthors().SingleOrDefault(a => a.Id == id);

            if (authorToDelete == null)
            {
                throw new NotFoundException("invalid author to delete");
            }
            return(authorsRepository.DeleteAuthor(id));
        }
Ejemplo n.º 4
0
     public IActionResult Delete(int authorId)
      {
             if(!AuthorsRepository.AuthorExists(authorId))
              {
                     return NotFound();
                 
     }
             AuthorsRepository.DeleteAuthor(authorId);
             return Ok();
         
 }
Ejemplo n.º 5
0
 public IActionResult DeleteAuthor(Guid id)
 {
     _repository.DeleteAuthor(id);
     return(NoContent());
 }