public NewBookFormData GetFormData()
        {
            var authors    = _mapper.Map <List <AuthorForListDTO> >(_authorRepository.GetList());
            var publishers = _mapper.Map <List <PublisherForListDTO> >(_publisherRepository.GetList());
            var categories = _mapper.Map <List <CategoryForListDTO> >(_categoryRepo.GetList());

            if (authors.Any() && publishers.Any() && categories.Any())
            {
                return(new NewBookFormData()
                {
                    Authors = authors,
                    Publishers = publishers,
                    Categories = categories
                });
            }

            return(null);
        }
예제 #2
0
        public IEnumerable <Category> GetAllCategory()
        {
            var listCategory = _categoryRepository.GetList();

            return(listCategory);
        }