示例#1
0
 public IndexModel(IPopularityService popularityService, IMovieService movieService, IGenresService genresService, IMapper mapper)
 {
     _popularityService = popularityService;
     _movieService      = movieService;
     _genresService     = genresService;
     _mapper            = mapper;
 }
示例#2
0
 public static void RegisterAll(ISortManager <Product> sortManager, IPopularityService popularityService)
 {
     sortManager.RegisterPlainSorter("low", (x, y) => x.Price.CompareTo(y.Price));
     sortManager.RegisterPlainSorter("high", (x, y) => y.Price.CompareTo(x.Price));
     sortManager.RegisterPlainSorter("ascending", (x, y) => x.Name.CompareTo(y.Name));
     sortManager.RegisterPlainSorter("descending", (x, y) => y.Name.CompareTo(x.Name));
     sortManager.RegisterComplexSorter("recommended", new ProductRecommendedSort(popularityService));
 }
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="logger"></param>
 /// <param name="serviceScopeFactory"></param>
 /// <param name="workQueue"></param>
 /// <param name="popularityService"></param>
 public RecommendationService(ILogger <RecommendationService> logger, IServiceScopeFactory serviceScopeFactory,
                              IWorkQueue workQueue, IPopularityService popularityService)
 {
     Logger            = logger;
     ScopeFactory      = serviceScopeFactory;
     WorkQueue         = workQueue;
     PopularityService = popularityService;
 }
 public RefreshCacheTask(IConfiguration configuration,
                         IProductPopularityCache cache,
                         IPopularityService productPopularityService)
 {
     _configuration            = configuration;
     _cache                    = cache;
     _productPopularityService = productPopularityService;
 }
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="context"></param>
 /// <param name="logger"></param>
 /// <param name="mapper"></param>
 /// <param name="httpClient"></param>
 /// <param name="appSettings"></param>
 /// <param name="analyticsService"></param>
 /// <param name="recommendationService"></param>
 /// <param name="distributedCache"></param>
 /// <param name="workQueue"></param>
 /// <param name="popularityService"></param>
 public EventService(ApplicationContext context, ILogger <EventService> logger, IMapper mapper,
                     HttpClient httpClient, IOptions <AppSettings> appSettings, IAnalyticsService analyticsService,
                     IRecommendationService recommendationService, IDistributedCache distributedCache,
                     IWorkQueue workQueue, IPopularityService popularityService)
 {
     Logger                = logger;
     ApplicationContext    = context;
     Mapper                = mapper;
     HttpClient            = httpClient;
     AppSettings           = appSettings.Value;
     AnalyticsService      = analyticsService;
     RecommendationService = recommendationService;
     DistributedCache      = distributedCache;
     WorkQueue             = workQueue;
     PopularityService     = popularityService;
 }
示例#6
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env,
                              ISortManager <Product> sortManager, IPopularityService popularityService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseMvc();

            ProductSortRegister.RegisterAll(sortManager, popularityService);
        }
 public UserController(IPopularityService popularityService)
 {
     _popularityService = popularityService;
 }
 /// <summary>
 /// Constructor, injects logger and popularity service
 /// </summary>
 /// <param name="logger">ILogger</param>
 /// <param name="popularityService">IPopularityService</param>
 public PopularityWatchDog(ILogger <PopularityWatchDog> logger, IPopularityService popularityService)
 {
     Logger            = logger;
     PopularityService = popularityService;
 }
示例#9
0
 public ToppingsController(IPopularityService popularityService)
 {
     _popularityService = popularityService;
 }
示例#10
0
 public SearchService(BooksSQLiteContext context, IPopularityService _service)
 {
     db = context;
     _popularityService = _service;
 }
示例#11
0
 public ProductRecommendedComparer(IPopularityService popularityService)
 {
     _popularityService = popularityService;
 }
示例#12
0
 public ProductRecommendedSort(IPopularityService popularityService)
 {
     _popularityService = popularityService;
 }
 /// <inheritdoc />
 public PopularityController(ILogger <PopularityController> logger, IPopularityService popularityService)
 {
     Logger            = logger;
     PopularityService = popularityService;
 }