Exemplo n.º 1
0
    private OldRoutesDictionary GetOldRoutes(IStatefulNotification notification)
    {
        if (notification.State.ContainsKey(NotificationStateKey) == false)
        {
            notification.State[NotificationStateKey] = new OldRoutesDictionary();
        }

        return((OldRoutesDictionary?)notification.State[NotificationStateKey] ?? new OldRoutesDictionary());
    }
Exemplo n.º 2
0
    private void CreateRedirectsForOldRoutes(IStatefulNotification notification)
    {
        // don't let the notification handlers kick in if Redirect Tracking is turned off in the config
        if (_webRoutingSettings.CurrentValue.DisableRedirectUrlTracking)
        {
            return;
        }

        OldRoutesDictionary oldRoutes = GetOldRoutes(notification);

        CreateRedirects(oldRoutes);
    }
Exemplo n.º 3
0
    private void StoreOldRoutes(IEnumerable <IContent> entities, IStatefulNotification notification)
    {
        // don't let the notification handlers kick in if Redirect Tracking is turned off in the config
        if (_webRoutingSettings.CurrentValue.DisableRedirectUrlTracking)
        {
            return;
        }

        OldRoutesDictionary oldRoutes = GetOldRoutes(notification);

        foreach (IContent entity in entities)
        {
            StoreOldRoute(entity, oldRoutes);
        }
    }