public bool DeleteBrochure(int id) { try { _brochureRepository.Delete(id); return(true); } catch { return(false); } }
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(); }
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); } }
public void Delete(int id) { _brochureRepository.Delete(id); }
public async Task Delete(int id) { await _brochureRepository.Delete(id); }
public void Delete(int id) { Brochure brochureModel = _brochureRepository.Get(id); _brochureRepository.Delete(brochureModel); }