BrickPile.UI.Areas.UI.Controllers.PagesController.Delete C# (CSharp) Method

Delete() private method

private Delete ( string id, bool permanent ) : System.Web.Mvc.ActionResult
id string
permanent bool
return System.Web.Mvc.ActionResult
        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();
        }