Exemple #1
0
        public RouteTranslationBuilder WhereUntranslated()
        {
            if (CurrentRouteSelectorFunc != null)
            {
                Logger.LogWarning($"{nameof(CurrentRouteSelectorFunc)} is not null, will be overridden.");
            }

            CurrentRouteSelectorFunc = (Func <UntranslatedRoutesRouteSelector>)(() => new UntranslatedRoutesRouteSelector()
            {
                Culture   = CurrentCultures.Single(),
                Localizer = RouteTranslationConfiguration.Localizer,
            });

            return(this);
        }
Exemple #2
0
        public RouteTranslationBuilder TranslateController(string template)
        {
            IRouteProcessor routeProcessor = new TranslateControllerRouteProcessor(RouteTranslationConfiguration,
                                                                                   LoggerFactory.CreateLogger <TranslateControllerRouteProcessor>())
            {
                Culture  = CurrentCultures.Single(),
                Template = template,
            };

            RouteTranslationStore.Add(new RouteSelectorProcessorPair
            {
                Selector  = CurrentRouteSelectorFunc(),
                Processor = routeProcessor,
            });

            return(this);
        }