#pragma warning restore IDE0044 // Add readonly modifier

        /// <summary>
        /// Initializes a new instance of the <see cref="UmbracoRequestMiddleware"/> class.
        /// </summary>
        public UmbracoRequestMiddleware(
            ILogger <UmbracoRequestMiddleware> logger,
            IUmbracoContextFactory umbracoContextFactory,
            IRequestCache requestCache,
            PublishedSnapshotServiceEventHandler publishedSnapshotServiceEventHandler,
            IEventAggregator eventAggregator,
            IProfiler profiler,
            IHostingEnvironment hostingEnvironment,
            UmbracoRequestPaths umbracoRequestPaths,
            BackOfficeWebAssets backOfficeWebAssets,
            IOptions <SmidgeOptions> smidgeOptions,
            IRuntimeState runtimeState,
            IVariationContextAccessor variationContextAccessor,
            IDefaultCultureAccessor defaultCultureAccessor)
        {
            _logger = logger;
            _umbracoContextFactory = umbracoContextFactory;
            _requestCache          = requestCache;
            _publishedSnapshotServiceEventHandler = publishedSnapshotServiceEventHandler;
            _eventAggregator          = eventAggregator;
            _hostingEnvironment       = hostingEnvironment;
            _umbracoRequestPaths      = umbracoRequestPaths;
            _backOfficeWebAssets      = backOfficeWebAssets;
            _runtimeState             = runtimeState;
            _variationContextAccessor = variationContextAccessor;
            _defaultCultureAccessor   = defaultCultureAccessor;
            _smidgeOptions            = smidgeOptions.Value;
            _profiler = profiler as WebProfiler; // Ignore if not a WebProfiler
        }
Пример #2
0
 public UmbracoRequestMiddleware(
     ILogger <UmbracoRequestMiddleware> logger,
     IUmbracoContextFactory umbracoContextFactory,
     IRequestCache requestCache,
     PublishedSnapshotServiceEventHandler publishedSnapshotServiceEventHandler,
     IEventAggregator eventAggregator,
     IProfiler profiler,
     IHostingEnvironment hostingEnvironment,
     UmbracoRequestPaths umbracoRequestPaths,
     BackOfficeWebAssets backOfficeWebAssets,
     IOptions <SmidgeOptions> smidgeOptions,
     IRuntimeState runtimeState,
     IVariationContextAccessor variationContextAccessor,
     IDefaultCultureAccessor defaultCultureAccessor)
     : this(
         logger,
         umbracoContextFactory,
         requestCache,
         publishedSnapshotServiceEventHandler,
         eventAggregator,
         profiler,
         hostingEnvironment,
         umbracoRequestPaths,
         backOfficeWebAssets,
         smidgeOptions,
         runtimeState,
         variationContextAccessor,
         defaultCultureAccessor,
         StaticServiceProvider.Instance.GetRequiredService <IOptions <UmbracoRequestOptions> >())
 {
 }