public async Task <Models.Author> DeleteAuthor(int id) { var result = await _authorRepository.DeleteAuthor(id); Models.Author authorModel = _mapper.Map <Models.Author>(result); return(authorModel); }
public IActionResult Delete(int authorId) { if (!authorsRepository.AuthorExists(authorId)) { return(NotFound()); } authorsRepository.DeleteAuthor(authorId); return(Ok()); }
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)); }
public IActionResult Delete(int authorId) { if(!AuthorsRepository.AuthorExists(authorId)) { return NotFound(); } AuthorsRepository.DeleteAuthor(authorId); return Ok(); }
public IActionResult DeleteAuthor(Guid id) { _repository.DeleteAuthor(id); return(NoContent()); }