Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class ArchiveContentFinder : IContentFinder
{
public bool TryFindContent(PublishedContentRequest contentRequest)
{
var path = contentRequest.Uri.GetAbsolutePathDecoded();
var db = ApplicationContext.Current.DatabaseContext.Database;
var archived = db.SingleOrDefault<Archive>("select * from archive where Url = @0 or Url = @1", path, path + "/");
if(archived != null)
{
var content = new MyPublishedContent(archived.Xml);
contentRequest.PublishedContent = content;
return true;
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.