/// <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());
 }
Beispiel #3
0
        public IActionResult DeletePublisher(int id)
        {
            Publisher publisher = _publisherRepository.GetById(id);

            if (publisher == null)
            {
                return(NotFound());
            }

            _publisherRepository.Delete(publisher);
            _publisherRepository.Save();

            return(Ok(publisher));
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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}"));
            }
        }
Beispiel #6
0
 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);
        }
Beispiel #9
0
 public async Task Delete(int id)
 {
     await m_repository.Delete(id);
 }
 public void Delete(Publisher publisher)
 {
     _publisherRepository.Delete(publisher);
 }
Beispiel #11
0
 public ActionResult Delete(int id)
 {
     repo.Delete(id);
     return(RedirectToAction("ListOfPublisher"));
 }
Beispiel #12
0
 public void Delete(int publisherID)
 {
     _publisherRepository.Delete(publisherID);
 }
 public void Delete(Publisher entity)
 {
     _publisherRepository.Delete(entity);
 }
Beispiel #14
0
        public void Delete(int id)
        {
            var publisher = GetById(id);

            _repository.Delete(publisher);
        }
Beispiel #15
0
 public async Task Delete(Publisher publisher)
 {
     await _publisherRepository.Delete(publisher);
 }
Beispiel #16
0
 public void Delete(int id)
 {
     _publisherRepository.Delete(id);
 }
Beispiel #17
0
 public async Task <Publisher> Delete(int id)
 {
     return(await _publisherRepository.Delete(id));
 }
Beispiel #18
0
 public void Delete(int id)
 {
     repo.Delete(id);
 }