/// <summary> /// Deletes the specified content and its related file. /// </summary> public bool DeleteAll() { var content = Content.Get("content_id = @0", Content.Id); var permalinks = Permalink.Get("permalink_id = @0", Content.PermalinkId); using (IDbTransaction tx = Database.OpenTransaction()) { try { // Call OnDelete for all extensions foreach (var ext in Extensions) { ext.Body.OnManagerDelete(Content); } File.Delete(HttpContext.Current.Server.MapPath("~/App_Data/Content/" + Content.Id)); foreach (var c in content) { c.Delete(tx); } foreach (var p in permalinks) { p.Delete(tx); } tx.Commit(); return(true); } catch { tx.Rollback(); } } return(false); }