public IEnumerable <PublicationViewModel> GetAll() { List <Publication> publications = _publicationRepository.GetAll().ToList(); var result = Mapper.Map <List <Publication>, List <PublicationViewModel> >(publications); return(result); }
public void TestEntityGetAllUser() { var mockTeste = new Mock <IGetDB <Publication> >(); var publicationRepository = new PublicationRepository(mockTeste.Object); publicationRepository.GetAll(); mockTeste.Verify(x => x.GetAllRegister()); }
public IEnumerable <LibraryViewModel> GetLibrary() { List <Book> books = _bookRepository.GetAll().ToList(); var viewBooks = Mapper.Map <List <Book>, List <LibraryViewModel> >(books); List <Brochure> brochures = _brochureRepository.GetAll().ToList(); var viewBrochures = Mapper.Map <List <Brochure>, List <LibraryViewModel> >(brochures); List <Gournal> gournals = _gournalRepository.GetAll().ToList(); var viewGournals = Mapper.Map <List <Gournal>, List <LibraryViewModel> >(gournals); List <Publication> publications = _publicationRepository.GetAll().ToList(); var viewPublications = Mapper.Map <List <Publication>, List <LibraryViewModel> >(publications); List <LibraryViewModel> library = new List <LibraryViewModel>(); library.AddRange(viewBooks); library.AddRange(viewBrochures); library.AddRange(viewGournals); library.AddRange(viewPublications); return(library); }