Oct 2, 2012 at 11:56 AM
Edited Oct 2, 2012 at 12:39 PM
I'm writing a redirect module where I need to see if the Path of a ContentItem/RoutePart has been changed. But I can't find how exactly to do this. My best guess is that I should do this in the Handler. But the methods I can use are a bit confusing and so
is the context. For example:
protected override void Unpublishing(PublishContentContext context)
var current = context.ContentItem.As<RoutePart>();
var result = context.PreviousItemVersionRecord.As<RoutePart>();
var previous = result.As<RoutePart>();
if (current.Path != previous.Path)
// Do stuff
What I'm trying to do here is find the path of the previous version and compare it to the current. But since the previous item is a VersionRecord it does not have the "As<>" method from which I can retrieve the routepart.
What am I missing?