/// <summary> /// Deletes this instance. /// </summary> public void Delete() { //delete the assigned applications SqlHelper.ExecuteNonQuery("delete from umbracoUser2App where app = @appAlias", SqlHelper.CreateParameter("@appAlias", this.alias)); //delete the assigned trees var trees = ApplicationTree.getApplicationTree(this.alias); foreach (var t in trees) { t.Delete(); } SqlHelper.ExecuteNonQuery("delete from umbracoApp where appAlias = @appAlias", SqlHelper.CreateParameter("@appAlias", this._alias)); ReCache(); }
/// <summary> /// Deletes this instance. /// </summary> public void Delete() { //delete the assigned applications SqlHelper.ExecuteNonQuery("delete from umbracoUser2App where app = @appAlias", SqlHelper.CreateParameter("@appAlias", this.alias)); //delete the assigned trees var trees = ApplicationTree.getApplicationTree(this.alias); foreach (var t in trees) { t.Delete(); } LoadXml(doc => { doc.Root.Elements("add").Where(x => x.Attribute("alias") != null && x.Attribute("alias").Value == this.alias).Remove(); }, true); }