Beispiel #1
0
 public BookServiceBase(IBookFactory bookFactory, IBookServices bookServices,
                        IBookRepository repository)
 {
     _factory    = bookFactory;
     _services   = bookServices;
     _repository = repository;
 }
Beispiel #2
0
        public void ThrowArgumentNullException_WhenPassedParametersAreNull()
        {
            // Arrange
            IBookServices bookServices = null;

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() => new BookController(bookServices));
        }
Beispiel #3
0
        public BookController(IBookServices _book, IBookTypeServices _bookTypeServices, IPublishHouseServices _publishHouseServices)
        {
            book                 = _book;
            bookTypeServices     = _bookTypeServices;
            publishHouseServices = _publishHouseServices;

            this.log = LogManager.GetLogger(Startup.repository.Name, typeof(HomeController));
        }
Beispiel #4
0
 public AuthorsController(IAuthorServices services,
                          IBookServices bookServices,
                          IFileServices fileServices,
                          IParameterBuilder parameterBuilder)
 {
     _services         = services;
     _bookServices     = bookServices;
     _fileServices     = fileServices;
     _parameterBuilder = parameterBuilder;
 }
        public IActionResult GetBookById([FromServices] IBookServices bookServices, [FromRoute] int bookId)
        {
            var book = bookServices.GetBookById(bookId);

            if (book == null)
            {
                return(NotFound());
            }

            return(new JsonResult(book));
        }
 public RentalsController(
     IRentalServices rentalServices,
     IParameterBuilder parameterBuilder,
     ICustomerServices customerServices,
     IBookServices bookServices)
 {
     _rentalServices   = rentalServices;
     _customerServices = customerServices;
     _bookServices     = bookServices;
     _parameterBuilder = parameterBuilder;
 }
Beispiel #7
0
 public BookController(IBookServices bookServices,
                       IAuthorServices authorServices,
                       IUserBookServices userBookServices,
                       UserManager <User> userManager
                       )
 {
     this.bookServices     = bookServices;
     this.authorServices   = authorServices;
     this.userBookServices = userBookServices;
     this.userManager      = userManager;
 }
 public BooksController(IBookServices services,
                        IAuthorServices authorServices,
                        IGenreServices genreServices,
                        IParameterBuilder parameterBuilder,
                        IFileServices fileServices)
 {
     _services         = services;
     _authorServices   = authorServices;
     _genreServices    = genreServices;
     _fileServices     = fileServices;
     _parameterBuilder = parameterBuilder;
 }
Beispiel #9
0
 public BookController(IBookServices bookServices,
                       IResourceServices resourceServices,
                       IWebHostEnvironment webHostEnvironment,
                       IConfiguration configuration,
                       ISearchServices searchServices)
 {
     _configuration      = configuration;
     _resourceServices   = resourceServices;
     _bookServices       = bookServices;
     _searchServices     = searchServices;
     _webHostEnvironment = webHostEnvironment;
 }
Beispiel #10
0
 public UserController(UserManager <User> userManager,
                       SignInManager <User> signInManager,
                       IUserServices userServices,
                       IUserBookServices userBookServices,
                       IBookServices bookServices)
 {
     this.userManager      = userManager;
     this.signInManager    = signInManager;
     this.userServices     = userServices;
     this.userBookServices = userBookServices;
     this.bookServices     = bookServices;
 }
        public IActionResult DeleteBook([FromServices] IBookServices bookServices, [FromRoute] int bookId)
        {
            var deleteCount = bookServices.DeleteBook(bookId);

            if (deleteCount > 0)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
        public IActionResult UpdateBook([FromServices] IBookServices bookServices, [FromRoute] int bookId, Book book)
        {
            var updateCount = bookServices.UpdateBook(bookId, book);

            if (updateCount > 0)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
        public IActionResult AddBook([FromServices] IBookServices bookServices, Book book)
        {
            var bookId = bookServices.AddBook(book);

            if (bookId > 0)
            {
                return(Created($"/api/books/book/{book.ID}", book));
            }
            else
            {
                return(NotFound());
            }
        }
        public BookDetailPresenter(IBookDetailView view, IBookServices bookService, IPictureServices pictureService) 
            : base(view)
        {
            Guard.WhenArgument(view, "View is null.").IsNull().Throw();
            Guard.WhenArgument(bookService, "Book service is null.").IsNull().Throw();
            Guard.WhenArgument(pictureService, "Picture service is null.").IsNull().Throw();

            this.bookService = bookService;
            this.pictureService = pictureService;

            this.View.OnGetBooksById += View_OnGetBooksById;
            this.View.OnGetPicturesByBookId += View_OnGetPicturesByBookId;
        }
Beispiel #15
0
 public RestApiController(
     IUserBookServices userBookServices,
     IUserServices userServices,
     IJsonServices jsonServices,
     IXmlServices xmlServices,
     ICsvServices csvServices,
     IQrCodeServices qrCodeServices,
     IBookServices bookServices)
 {
     this.userBookServices = userBookServices;
     this.userServices     = userServices;
     this.jsonServices     = jsonServices;
     this.xmlServices      = xmlServices;
     this.csvServices      = csvServices;
     this.qrCodeServices   = qrCodeServices;
     this.bookServices     = bookServices;
 }
        public BookCreatorPresenter(
            IBookCreatorView view,
            IAuthorServices authorService,
            IBookServices bookService,
            IGenreServices genreService,
            IPublisherServices publisherService)
            : base(view)
        {
            Guard.WhenArgument(view, "View is null.").IsNull().Throw();
            Guard.WhenArgument(authorService, "Author service is null.").IsNull().Throw();
            Guard.WhenArgument(bookService, "Book service is null.").IsNull().Throw();
            Guard.WhenArgument(genreService, "Genre service is null.").IsNull().Throw();
            Guard.WhenArgument(publisherService, "Publisher service is null.").IsNull().Throw();

            this.authorService    = authorService;
            this.bookService      = bookService;
            this.genreService     = genreService;
            this.publisherService = publisherService;
        }
Beispiel #17
0
        public BookSearcherPresenter(
            IBookSearcherView view,
            IAuthorServices authorService,
            IBookServices bookService,
            IGenreServices genreService,
            IPublisherServices publisherService)
            : base(view)
        {
            Guard.WhenArgument(authorService, "Author service is null.").IsNull().Throw();
            Guard.WhenArgument(bookService, "Book service is null.").IsNull().Throw();
            Guard.WhenArgument(genreService, "Genre service is null.").IsNull().Throw();
            Guard.WhenArgument(publisherService, "Publisher service is null.").IsNull().Throw();

            this.authorService    = authorService;
            this.bookService      = bookService;
            this.genreService     = genreService;
            this.publisherService = publisherService;

            this.View.OnAuthorsGetData    += View_OnAuthorsGetData;
            this.View.OnGenresGetData     += View_OnGenresGetData;
            this.View.OnPublishersGetData += View_OnPublishersGetData;
        }
Beispiel #18
0
 public BooksController(IBookServices BookServices)
 {
     bookServices = BookServices;
 }
Beispiel #19
0
 public BooksController(IBookServices bookServices)
 {
     _bookServices = bookServices;
 }
Beispiel #20
0
 public BookController(IBookServices objBookServices)
 {
     _objBookServices = objBookServices;
 }
Beispiel #21
0
 public BookRemover(IBookFactory bookFactory, IBookServices bookServices,
                    IBookRepository repository) : base(bookFactory, bookServices, repository)
 {
 }
Beispiel #22
0
 public BookController(IBookServices services, CategoryService categoryService)
 {
     this.bookservices    = services;
     this.categoryService = categoryService;
 }
Beispiel #23
0
 public BookController(IBookServices s)
 {
     bService = s;
 }
Beispiel #24
0
 public BookController(IBookServices bookServices)
 {
     this.bookService = bookServices;
 }
 public BooksController(IBookServices bookService)
 {
     _bookServices = bookService;
 }
 public BookController(IBookServices bookServices)
 {
     _service = bookServices;
 }
Beispiel #27
0
 public AuthorsController(IAuthorService authorService, IBookServices bookService)
 {
     this.authorsService = authorService;
     this.bookService    = bookService;
 }
 public MembersController(IMemberService memberService, ILoanService loanService, IBookServices bookServices)
 {
     this.bookServices  = bookServices;
     this.loanService   = loanService;
     this.memberService = memberService;
 }
Beispiel #29
0
 public BookServicesController(
     IBookServices repo
     )
 {
     _repo = repo;
 }
Beispiel #30
0
 public HomeController(IHomePageServices homePageServices, ISearchService searchService, IBookServices bookServices)
 {
     _homePageServices = homePageServices;
     _searchService    = searchService;
     _bookService      = bookServices;
 }
Beispiel #31
0
 public BookController(IBookServices bookServices, ILogger <BookController> logger)
 {
     _bookServices = bookServices;
     _logger       = logger;
 }