コード例 #1
0
 public bool DeleteBrochure(int id)
 {
     try
     {
         _brochureRepository.Delete(id);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
コード例 #2
0
        public void DeleteBrochure(string id)
        {
            var Brochure = GetBrochureById(id);
            var publicationInPublisihngHouses = _publicationInPublisihngHouses.Where(x => x.Publication.Id == Brochure.Publication.Id).ToList();

            foreach (var publicationInPublisihngHouse in publicationInPublisihngHouses)
            {
                _publicationInPublisihngHouseRepository.Delete(publicationInPublisihngHouse.Id);
            }
            _publicationRepository.Delete(Brochure.Publication.Id);

            _brochureRepository.Delete(id);
            _brochureRepository.Save();
        }
コード例 #3
0
 public void Delete(DeleteAllPublicationView publication)
 {
     if (publication.Type == nameof(Book))
     {
         _bookRepository.Delete(publication.Id);
     }
     if (publication.Type == nameof(Magazine))
     {
         _magazineRepository.Delete(publication.Id);
     }
     if (publication.Type == nameof(Brochure))
     {
         _brochureRepository.Delete(publication.Id);
     }
 }
コード例 #4
0
 public void Delete(int id)
 {
     _brochureRepository.Delete(id);
 }
コード例 #5
0
 public async Task Delete(int id)
 {
     await _brochureRepository.Delete(id);
 }
コード例 #6
0
        public void Delete(int id)
        {
            Brochure brochureModel = _brochureRepository.Get(id);

            _brochureRepository.Delete(brochureModel);
        }