public ActionResult Delete(string id, bool permanent)
{
using (IDocumentSession session = this.documentStore.OpenSession())
{
var model = session.Load<IPage>(id.Replace("_", "/"));
if (permanent)
{
session.Delete(model);
}
else
{
model.Metadata.IsDeleted = true;
}
session.SaveChanges();
}
return new EmptyResult();
}