private OldRoutesDictionary GetOldRoutes(IStatefulNotification notification) { if (notification.State.ContainsKey(NotificationStateKey) == false) { notification.State[NotificationStateKey] = new OldRoutesDictionary(); } return((OldRoutesDictionary?)notification.State[NotificationStateKey] ?? new OldRoutesDictionary()); }
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); }
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); } }