public IActionResult Delete(long id) { try { _listService.Delete(id); return(Ok(new { Message = "Successful" })); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public ActionResult Delete(int id) { if (!CheckPermission(ListsPermissions.ManageLists)) { return(new HttpUnauthorizedResult()); } var list = listService.GetById(id); listService.Delete(list); listPathConstraint.RemovePath(list.Url); return(new AjaxResult().NotifyMessage("DELETE_LIST_COMPLETE")); }
public void Delete(SPList list, bool delete) { if (list == null) { throw new NullReferenceException("List cannot be null."); } if (list.Id == Guid.Empty) { throw new InvalidOperationException("Id cannot be empty."); } if (string.IsNullOrEmpty(list.SPWebUrl)) { throw new InvalidOperationException("SPWebUrl cannot be empty."); } try { Events.OnBeforeDelete(list); } catch (Exception ex) { string message = string.Format("An exception of type {0} occurred in the PublicApi.Lists.Events.OnBeforeDelete() method GroupId: {1} ListId: {2} SPWebUrl: {3} Delete: {4}. The exception message is: {5}", ex.GetType(), list.GroupId, list.Id, list.SPWebUrl, delete, ex.Message); SPLog.UnKnownError(ex, message); } listService.Delete(list.Id, delete); ExpireTags(list.GroupId); try { Events.OnAfterDelete(list); } catch (Exception ex) { string message = string.Format("An exception of type {0} occurred in the PublicApi.Lists.Events.OnAfterDelete() method GroupId: {1} ListId: {2} SPWebUrl: {3} Delete: {4}. The exception message is: {5}", ex.GetType(), list.GroupId, list.Id, list.SPWebUrl, delete, ex.Message); SPLog.UnKnownError(ex, message); } }
public IActionResult DeleteList([FromQuery] Guid listId) { _listService.Delete(listId); return(NoContent()); }
public void DeleteLists(int id) { _listService.Delete(id); }