Exemple #1
0
 /// <summary>
 /// Creats a new instance of <see cref="BookDataSeeder"/>
 /// </summary>
 /// <param name="hosting">Used for getting the Json data from the content root of the application</param>
 /// <param name="context">Used to add the seed data to the database</param>
 /// <param name="logger">Used for logging</param>
 /// <param name="bookImageService">Used for seeding <see cref="Book"/> Images</param>
 public BookDataSeeder(IHostingEnvironment hosting, BooksDbContext context,
                       ILogger <BookDataSeeder> logger, IBookImageService bookImageService)
 {
     _hosting          = hosting;
     _context          = context;
     _logger           = logger;
     _bookImageService = bookImageService;
 }
Exemple #2
0
 public BookController(IBookService bookService, ICategoryService categoryService, IPublisherService publisherService, IAuthorService authorService, IBookImageService bookImageService)
 {
     _bookService      = bookService;
     _categoryService  = categoryService;
     _publisherService = publisherService;
     _authorService    = authorService;
     _bookImageService = bookImageService;
 }
        /// <summary>
        /// Creates a new instance of <see cref="BooksController"/>
        /// </summary>
        /// <param name="bookRepository">Used for manipulating and accessing <see cref="Book"/> resources</param>
        /// <param name="logger">Used for logging</param>
        /// <param name="imageService">Used for saving and deleting <see cref="Book"/> Images</param>
        /// <param name="config">Used to access the application configuration</param>
        public BooksController(IBookRepositoryService bookRepository, ILogger <BooksController> logger,
                               IBookImageService imageService, IConfiguration config)
        {
            _bookRepository = bookRepository;
            _logger         = logger;
            _imageService   = imageService;
            _config         = config;

            int.TryParse(_config["Books:PageSize"], out PageSize);
            int.TryParse(_config["Books:ImageSize"], out BookImageSize);
        }
Exemple #4
0
 public BookImagesController(IBookImageService bookImageService)
 {
     _bookImageService = bookImageService;
 }
 public BookImagesController(IWebHostEnvironment webHostEnvironment, IBookImageService bookImageService)
 {
     _webHostEnvironment = webHostEnvironment;
     _bookImageService   = bookImageService;
 }