public BooksController()
 {
     BookModelContainer db = new BookModelContainer();
     this.bookRepository = new BookRepository(db);
     this.authorRepository = new AuthorRepository(db);
     this.categoryRepository = new CategoryRepository(db);
 }
Exemple #2
0
 public BookImporter(IGoogleBooksClient googleBooksClient, IBookRepository books)
 {
     if (googleBooksClient == null) throw new ArgumentNullException("googleBooksClient");
     if (books == null) throw new ArgumentNullException("books");
     this.googleBooksClient = googleBooksClient;
     this.books = books;
 }
 public BooksController(
     IBookRepository _bookRepository,
     Func<IAuthorRepository> _authorRepository)
 {
     bookRepository = _bookRepository;
     authorRepository = _authorRepository;
 }
 public TileManager(
     IBookRepository bookRepository,
     INavigationService navigationService)
 {
     _bookRepository = bookRepository;
     _navigationService = navigationService;
 }
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IChapterRepository chapterRepository ,IBookRepository bookRepository, ICategoryRepository categoryRepository)
        {
            _chapterRepository = chapterRepository;
            _bookRepository = bookRepository;
            _categoryRepository = categoryRepository;

            Chapters = new ObservableCollection<Chapter>(_chapterRepository.FindAll());
            Books = new ObservableCollection<Book>(_bookRepository.FindAll());
            Categories = new ObservableCollection<Category>(_categoryRepository.FindAll());

            SelectedBook = new Book();
            SelectedCategory = new Category();
            SelectedChapter = new Chapter();

            //
            Books.Add(new Book(1,"Cánh đồng bất tận", "Nguyễn Ngọc Tư","2011","NXB Tuổi Trẻ",new Media(),new Media()));
            Books.Add(new Book(1, "Sống để kể lại", "Nguyễn Ngọc Tư", "2011", "NXB Tuổi Trẻ", new Media(), new Media()));

            Categories.Add(new Category(1, "Cuộc sống", new Media()));
            Categories.Add(new Category(1, "Tình yêu", new Media()));
            Categories.Add(new Category(1, "Kỹ năng", new Media()));

            Chapters.Add(new Chapter(1, "Giới thiệu sách nói", new Media(), new Media()));
            Chapters.Add(new Chapter(1, "Trở thành biên tập viên ở El Espectador", new Media(), new Media()));
            Chapters.Add(new Chapter(1, "Thử lửa với công việc phóng viên xung kích", new Media(), new Media()));
            Chapters.Add(new Chapter(1, "Công việc viết phê bình điện ảnh", new Media(), new Media()));
        }
 public LoanService(IBookRepository bookRepository,
                    IMemberRepository memberRepository,
                    IUnitOfWork unitOfWork)
 {
     _bookRepository = bookRepository;
     _memberRepository = memberRepository;
     _unitOfWork = unitOfWork;
 }
        public BookService(string context, IBookRepository repository, ILoggerFactory loggerFactory)
        {
            this.repository = repository;
            this.userName = context;

            if (logger == null)
                logger = loggerFactory.Create<BookService>();
        }
 public OnlineBookStoreService(IBookRepository bookRepository, IDictionaryRepository dictionaryRepository, IOrderRepository orderRepository, ICustomerRepository customerRepository, IAdapter adapter)
 {
     this._bookRepository = bookRepository;
     this._dictionaryRepository = dictionaryRepository;
     this._orderRepository = orderRepository;
     this._customerRepository = customerRepository;
     this._adapter = adapter;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductRepositoryLocator" /> class.
        /// </summary>
        /// <param name="bookRepository">The book repository.</param>
        /// <param name="movieRepository">The movie repository.</param>
        public ProductRepositoryLocator(IBookRepository bookRepository, IMovieRepository movieRepository)
        {
            Guard.ArgumentNotNull(bookRepository, "bookRepository");
            Guard.ArgumentNotNull(movieRepository, "movieRepository");

            this.bookRepository = bookRepository;
            this.movieRepository = movieRepository;
        }
 public BookOrchestration(IBookRepository bookRepository,
     IAuthorRepository authorRepository,
     IGenreRepository genreRepository)
 {
     _bookRepository = bookRepository;
     _authorRepository = authorRepository;
     _genreRepository = genreRepository;
 }
 public BookDownloader(IBookRepository bookService, IFileLoadingFactory fileLoadingFactory, IDownloadsContainer container, 
     IBookDownloadsRepository bookDownloadsRepository)
 {
     _bookService = bookService;
     _fileLoadingFactory = fileLoadingFactory;
     _container = container;
     _bookDownloadsRepository = bookDownloadsRepository;
 }
 public EditBookPageViewModel(
     IBookRepository bookRepository, 
     INavigationService navigationService,
     ITileManager tileManager)
 {
     _bookRepository = bookRepository;
     _navigationService = navigationService;
     _tileManager = tileManager;
 }
 /// <summary>
 /// Initializes a new instance of the MainViewModel class.
 /// </summary>
 public MainViewModel(IBookRepository bRepo, IDialogProvider dialogProvider)
 {
     _bRepo = bRepo;
     _dialogProvider = dialogProvider;
     SelectedBook = null;
     SearchCommand = new RelayCommand(ExecuteSearch);
     ReadOnlineCommand = new RelayCommand(OpenBookOnline,
         () => SelectedBook != null && SelectedBook.WebReaderLink != null);
 }
        public BookControllerTests()
        {
            autoMapperConfiguration = new AutoMapperConfiguration();
            autoMapperConfiguration.Configure();
            fixture = new Fixture().Customize(new AutoFixtureCustomization());

            mocks = new MockRepository();
            bookRepositoryMock = mocks.DynamicMock<IBookRepository>();
            controller = new BookController(bookRepositoryMock);
        }
Exemple #15
0
 public ReadController(IBookView page, string bookId, IBookRepository bookRepository, int offset = 0)
 {
     _data = new BookData(bookId);
     _bookView = page;
     _offset = offset;
     _bookRepository = bookRepository;
     _bookModel = _bookRepository.Get(bookId);
     _images = _data.LoadImages().ToList();
     _pageLoader = new PageCompositor(_bookModel, (int)(AppSettings.Default.FontSettings.FontSize), new Size(page.GetSize().Width - AppSettings.Default.Margin.Left - AppSettings.Default.Margin.Right, page.GetSize().Height - AppSettings.Default.Margin.Top - AppSettings.Default.Margin.Bottom), _images);
     BookId = bookId;
 }
 public void FilterBooks(IBookRepository repository, Predicate<Book> filter)
 {
     IEnumerable<Book> books = new List<Book>(booksList);
     List<Book> filteredBooks = new List<Book>();
     foreach (Book item in books)
     {
         if (filter(item))
             filteredBooks.Add(item);
     }
     repository.SaveBooks(filteredBooks);
 }
 public DistributionController(
     IBookRepository _bookRepository,
     IBookCopysRepository _repo,
     ILibraryRepository _libraryRepository,
     ICurrent _current)
 {
     bookRepository = _bookRepository;
     repo = _repo;
     libraryRepository = _libraryRepository;
     current = _current;
 }
 public LibraryService(IBookTitleRepository bookTitleRepository,
                      IBookRepository bookRepository, 
                      IMemberRepository memberRepository,
                      IUnitOfWork unitOfWork)
 {            
     _uow = unitOfWork;
     _memberRepository = memberRepository; 
     _bookTitleRepository = bookTitleRepository;
     _bookRepository = bookRepository;
     _loanService = new LoanService(_bookRepository, _memberRepository, _uow);
 }
 public SearchInBookPageViewModel(
     INavigationService navigationService,
     IBookRepository bookRepository, 
     SearchInBookController searchController,
     IBusyIndicatorManager busyIndicatorManager,
     BookSearch bookSearch)
 {
     _navigationService = navigationService;
     _bookRepository = bookRepository;
     _searchController = searchController;
     _busyIndicatorManager = busyIndicatorManager;
     _bookSearch = bookSearch;
 }
 public BookmarkSearchPageViewModel(
     INavigationService navigationService,
     IBookmarkRepository bookmarkRepository,
     BookmarksController bookmarksController,
     IBookRepository bookRepository,
     IBusyIndicatorManager busyIndicatorManager)
 {
     _navigationService = navigationService;
     _bookmarkRepository = bookmarkRepository;
     _bookmarksController = bookmarksController;
     _bookRepository = bookRepository;
     _busyIndicatorManager = busyIndicatorManager;
 }
 public ReadPageViewModel(
     INavigationService navigationService,
     ITileManager tileManager, 
     IBookRepository bookRepository,
     SharingDataModel sharingDataModel,
     IBusyOverlayManager busyOverlay)
 {
     SharingDataModel = sharingDataModel;
     _navigationService = navigationService;
     _tileManager = tileManager;
     _bookRepository = bookRepository;
     _busyOverlay = busyOverlay;
 }
 public ThisBookBookmarksViewModel(
     INavigationService navigationService,
     BookmarksController bookmarksController, 
     IBookmarkRepository bookmarkService,
     IBookRepository bookService,
     IBusyIndicatorManager busyIndicatorManager,
     IEventAggregator eventAggregator) : base(navigationService, bookmarkService, eventAggregator)
 {
     _bookmarksController = bookmarksController;
     _bookmarkService = bookmarkService;
     _bookRepository = bookService;
     _busyIndicatorManager = busyIndicatorManager;
     DisplayName = UIStrings.BookmarksPivot_ThisBook;
 }
Exemple #23
0
        public BookService(IBookRepository bookRepository, IAuthorRepository authorRepository)
        {
            if (bookRepository == null)
            {
                throw new ArgumentNullException(nameof(bookRepository));
            }

            if (authorRepository == null)
            {
                throw new ArgumentNullException(nameof(authorRepository));
            }

            _bookRepository = bookRepository;
            _authorRepository = authorRepository;
        }
        /// <summary>
        /// IBookRepository injection constructor
        /// </summary>
        /// <param name="bookRepository">Injection of type IBookRepository</param>
        public BookApiController(IBookOrchestration bookOrchestration,
            IBookRepository bookRepository,
            ILocalLogger localLogger)
        {
            if (localLogger == null)
            {
                throw new ArgumentNullException("localLogger");
            }

            if (bookOrchestration == null)
            {
                throw new ArgumentNullException("bookOrchestration");
            }

            if (bookRepository == null)
            {
                throw new ArgumentNullException("bookRepository");
            }

            _localLogger = localLogger;
            _bookOrchestration = bookOrchestration;
            _bookRepository = bookRepository;
        }
Exemple #25
0
        public Importer(IBookRepository bookRepository, ISourceRepository sourceRepository)
        {
            _sourcerepo = sourceRepository;
            _bookService = new BookService(bookRepository);
            _sourceService = new SourceService(sourceRepository);
            ProgressService.RegisterPublisher(this);
            Worker = new BackgroundWorker
            {
                WorkerReportsProgress = true,
                WorkerSupportsCancellation = true
            };
            Worker.DoWork += Worker_DoWork;
            Worker.RunWorkerCompleted += Worker_RunWorkerCompleted;
            Worker.ProgressChanged += Worker_ProgressChanged;

            WorkerCleanup = new BackgroundWorker
            {
                WorkerReportsProgress = true,
                WorkerSupportsCancellation = true
            };
            WorkerCleanup.DoWork += WorkerCleanup_DoWork;
            WorkerCleanup.RunWorkerCompleted += WorkerCleanup_RunWorkerCompleted;
            WorkerCleanup.ProgressChanged += WorkerCleanup_ProgressChanged;
        }
Exemple #26
0
 public BookController(IBookRepository bookRepository, ILanguageRepository languageRepository, IWebHostEnvironment webHostEnvironment)
 {
     _bookRepository = bookRepository;
     _languageRepository = languageRepository;
     _webHostEnvironment = webHostEnvironment;
 }
 public BookController(IBookRepository bookRepository)
 {
     aBookRepository  = bookRepository;
     this.fileHandler = new FileOperations();
 }
 public BookController(IBookRepository repo, IMapper mapper)
 {
     this.repo   = repo;
     this.mapper = mapper;
 }
 public BookService(IBookRepository repository, IUnitOfWork unitOfWork)
 {
     _repository = repository;
     _unitOfWork = unitOfWork;
 }
Exemple #30
0
 public HistoryService(IHistoryRepository repository, IBookRepository bookRepository, IClientRepository clientRepository)
 {
     this.repository       = repository;
     this.bookRepository   = bookRepository;
     this.clientRepository = clientRepository;
 }
 //constructor
 public CartModel(IBookRepository repo)
 {
     repository = repo;
 }
Exemple #32
0
 public LibraryController(ILibraryRepository libraryRepository, IMapper mapper, IOfficeRepository officeRepository, IBookRepository bookRepository)
 {
     _libraryRepository = libraryRepository ?? throw new ArgumentNullException(nameof(libraryRepository));
     _mapper            = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _officeRepository  = officeRepository;
     _bookRepository    = bookRepository;
 }
Exemple #33
0
 public BooksController(IBookRepository repo)
 {
     repository = repo;
 }
 public ShopAdminController(IBookRepository bRepo, ICommentRepository cRepo, IRateRepository rRepo)
 {
     bookRepository    = bRepo;
     commentRepository = cRepo;
     rateRepository    = rRepo;
 }
Exemple #35
0
 public BooksController(IBookRepository bookRepository, BookStoreDbContext context)
 {
     _bookRepository = bookRepository;
     _context        = context;
 }
Exemple #36
0
 public BookController(ICategoryRepository categoryRepository, IBookRepository bookRepository)
 {
     _categoryRepository = categoryRepository;
     _bookRepository     = bookRepository;
 }
 public BooksController(IBookRepository _repository)
 {
     repository = _repository;
 }
 public BookService(IBookRepository bookRepository)
 {
     _bookRepository = bookRepository;
 }
Exemple #39
0
 public BookstoreUnitOfWork(IDocumentRepository <Author> authorsRepository,
                            IBookRepository booksRepository)
 {
     AuthorsRepository = authorsRepository;
     BooksRepository   = booksRepository;
 }
 public HomeController(IBookRepository bookRepository)//showing number of books on home page
 {
     _bookRepository = bookRepository;
 }
 public BookRepositoryTests()
 {
     _bookRepository = GetRequiredService <IBookRepository>();
     _guidGenerator  = GetRequiredService <IGuidGenerator>();
 }
Exemple #42
0
 public BookService(IValidationDictionary validationDictionary, IBookRepository repository)
 {
     _validatonDictionary = validationDictionary;
     _repository          = repository;
 }
Exemple #43
0
 public BooksController(IBookRepository bookRepository, ITimeService timeService)
 {
     BookRepository = bookRepository;
     TimeService    = timeService;
 }
 public AdminController(IBookRepository repo)
 {
     repository = repo;
 }
 public BookService(IBookRepository BookRepository, ILogger <BookService> logger)
 {
     repository = BookRepository;
     _logger    = logger;
 }
Exemple #46
0
 public BookFacade(IBookRepository bookRepository, ICategoryRepository category, IBookUnitOfWork bookUnitOfWork)
 {
     _bookRepository = bookRepository;
     _category = category;
     _bookUnitOfWork = bookUnitOfWork;
 }
        public BooksController(IBookRepository bookRepository, ILogger<BooksController> logger)
        {
            _bookRepository = bookRepository ?? throw new ArgumentNullException(nameof(bookRepository));

            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
        }
 public BooksController(IBookRepository booksRepository)
 {
     repository = booksRepository;
 }
Exemple #49
0
 public BooksController(IBookRepository bookRepository)
 {
     _bookRepository = bookRepository;
 }
 public BooksController(IBookRepository bookRepository, IAuthorRepository authorRepository)
 {
     _bookRepository = bookRepository;
     _authorRepository = authorRepository;
 }
 public AddBookToFavoriteRequestHandler(IBookRepository bookRepository)
 {
     _bookRepository = bookRepository;
 }
Exemple #52
0
 public BookService(IBookRepository bookRepository)
 {
     _bookRepository = bookRepository;
 }
Exemple #53
0
 public BooksController(IBookRepository _books)
 {
     this.books = _books;
 }
 public BookController(IBookRepository bookRepository, IGenreRepository genreRepository)
 {
     _bookRepository  = bookRepository;
     _genreRepository = genreRepository;
 }
Exemple #55
0
 public BookController(IBookRepository bookRepository)
 {
     this._bookRepository = bookRepository;
 }