/// <summary> /// Remove uma editora. /// </summary> /// <param name="viewModel">ViewModel com as informações da editora.</param> /// <returns></returns> public async Task <bool> DeletePublisher(PublisherViewModel viewModel) { var publisher = viewModel.AutoMapear <PublisherViewModel, Publisher>(); _repository.Delete(publisher); OperationSuccesful = await _repository.Commit(); return(OperationSuccesful); }
public IActionResult Delete([FromBody] int[] ids) { if (_publisherRepository.Delete(ids)) { return(NoContent()); } return(NotFound()); }
public IActionResult DeletePublisher(int id) { Publisher publisher = _publisherRepository.GetById(id); if (publisher == null) { return(NotFound()); } _publisherRepository.Delete(publisher); _publisherRepository.Save(); return(Ok(publisher)); }
public bool DeletePublisher(int id) { var bookCount = _bookRepository.CountByPublisherId(id); if (bookCount > 0) { return(false); } int result = _publisherRepository.Delete(id); if (result == 0) { return(false); } return(true); }
public async Task <PublisherResponse> DeleteAsync(int id) { try { var publisher = await _publisherRepository.FindByIdAsync(id); if (publisher == null) { return(new PublisherResponse($"this publisher does't exists by id {id}")); } _publisherRepository.Delete(publisher); await _unityOfWork.CompleteAsync(); return(new PublisherResponse(publisher)); } catch (Exception e) { return(new PublisherResponse($"An error ocurred {e.Message}")); } }
public IActionResult Delete([FromBody] Publisher publisher) { _repository.Delete(publisher); return(new JsonResult(new { delete = true })); }
public void DeletePublisher(string id) { _publisherRepository.Delete(id); }
public async Task DeletePublisherById(int id) { var publisherFromDb = await _publisherRepository.GetByIdAsync(id); _publisherRepository.Delete(publisherFromDb); }
public async Task Delete(int id) { await m_repository.Delete(id); }
public void Delete(Publisher publisher) { _publisherRepository.Delete(publisher); }
public ActionResult Delete(int id) { repo.Delete(id); return(RedirectToAction("ListOfPublisher")); }
public void Delete(int publisherID) { _publisherRepository.Delete(publisherID); }
public void Delete(Publisher entity) { _publisherRepository.Delete(entity); }
public void Delete(int id) { var publisher = GetById(id); _repository.Delete(publisher); }
public async Task Delete(Publisher publisher) { await _publisherRepository.Delete(publisher); }
public void Delete(int id) { _publisherRepository.Delete(id); }
public async Task <Publisher> Delete(int id) { return(await _publisherRepository.Delete(id)); }
public void Delete(int id) { repo.Delete(id); }