public void TestEntityDelete() { var pub = PublicationBuilder.New().Build(); var mockTeste = new Mock <IDeleteDB <Publication> >(); var publicationRepository = new PublicationRepository(mockTeste.Object); publicationRepository.Delete(pub); mockTeste.Verify(x => x.DeleteRegister(It.IsAny <Publication>())); }
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 DeleteBook(string id) { var book = GetBookById(id); var publicationInPublisihngHouses = _publicationInPublisihngHouses.Where(x => x.Publication.Id == book.Publication.Id).ToList(); foreach (var publicationInPublisihngHouse in publicationInPublisihngHouses) { _publicationInPublisihngHouseRepository.Delete(publicationInPublisihngHouse.Id); _publicationInPublisihngHouseRepository.Save(); } _publicationRepository.Delete(book.Publication.Id); _publicationRepository.Save(); _bookRepository.Delete(id); _bookRepository.Save(); }
public void DeleteMagazine(string id) { var Magazine = GetMagazineById(id); var publicationInPublisihngHouses = _publicationInPublisihngHouses.Where(x => x.Publication.Id == Magazine.Publication.Id).ToList(); foreach (var publicationInPublisihngHouse in publicationInPublisihngHouses) { _publicationInPublisihngHouseRepository.Delete(publicationInPublisihngHouse.Id); _publicationInPublisihngHouseRepository.Save(); } _publicationRepository.Delete(Magazine.Publication.Id); _publicationRepository.Save(); _magazineRepository.Delete(id); _magazineRepository.Save(); }
public void Delete(int id) { _publicationRepository.Delete(id); }
public /*async*/ void Delete(int id) { /*await*/ publicationRepository.Delete(id); }