/// <summary> /// Sets the content last chance finder. /// </summary> /// <param name="builder">The builder.</param> /// <param name="finder">A last chance finder.</param> public static IUmbracoBuilder SetContentLastChanceFinder( this IUmbracoBuilder builder, IContentLastChanceFinder finder) { builder.Services.AddUnique(finder); return(builder); }
/// <summary> /// Initializes a new instance of the <see cref="PublishedRouter" /> class. /// </summary> public PublishedRouter( IOptionsMonitor <WebRoutingSettings> webRoutingSettings, ContentFinderCollection contentFinders, IContentLastChanceFinder contentLastChanceFinder, IVariationContextAccessor variationContextAccessor, IProfilingLogger proflog, ILogger <PublishedRouter> logger, IPublishedUrlProvider publishedUrlProvider, IRequestAccessor requestAccessor, IPublishedValueFallback publishedValueFallback, IFileService fileService, IContentTypeService contentTypeService, IUmbracoContextAccessor umbracoContextAccessor, IEventAggregator eventAggregator) { _webRoutingSettings = webRoutingSettings.CurrentValue ?? throw new ArgumentNullException(nameof(webRoutingSettings)); _contentFinders = contentFinders ?? throw new ArgumentNullException(nameof(contentFinders)); _contentLastChanceFinder = contentLastChanceFinder ?? throw new ArgumentNullException(nameof(contentLastChanceFinder)); _profilingLogger = proflog ?? throw new ArgumentNullException(nameof(proflog)); _variationContextAccessor = variationContextAccessor ?? throw new ArgumentNullException(nameof(variationContextAccessor)); _logger = logger; _publishedUrlProvider = publishedUrlProvider; _requestAccessor = requestAccessor; _publishedValueFallback = publishedValueFallback; _fileService = fileService; _contentTypeService = contentTypeService; _umbracoContextAccessor = umbracoContextAccessor; _eventAggregator = eventAggregator; webRoutingSettings.OnChange(x => _webRoutingSettings = x); }
/// <summary> /// Initializes a new instance of the <see cref="PublishedRouter"/> class. /// </summary> public PublishedRouter( IWebRoutingSection webRoutingSection, ContentFinderCollection contentFinders, IContentLastChanceFinder contentLastChanceFinder, IVariationContextAccessor variationContextAccessor, ServiceContext services, IProfilingLogger proflog) { _webRoutingSection = webRoutingSection ?? throw new ArgumentNullException(nameof(webRoutingSection)); _contentFinders = contentFinders ?? throw new ArgumentNullException(nameof(contentFinders)); _contentLastChanceFinder = contentLastChanceFinder ?? throw new ArgumentNullException(nameof(contentLastChanceFinder)); _services = services ?? throw new ArgumentNullException(nameof(services)); _profilingLogger = proflog ?? throw new ArgumentNullException(nameof(proflog)); _variationContextAccessor = variationContextAccessor ?? throw new ArgumentNullException(nameof(variationContextAccessor)); _logger = proflog; }
/// <summary> /// Sets the content last chance finder. /// </summary> /// <param name="composition">The composition.</param> /// <param name="finder">A last chance finder.</param> public static void SetContentLastChanceFinder(this Composition composition, IContentLastChanceFinder finder) { composition.RegisterUnique(_ => finder); }