예제 #1
0
        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>()));
        }
예제 #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 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();
        }
예제 #4
0
        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();
        }
예제 #5
0
 public void Delete(int id)
 {
     _publicationRepository.Delete(id);
 }
예제 #6
0
 public /*async*/ void Delete(int id)
 {
     /*await*/ publicationRepository.Delete(id);
 }