public async Task <string> DeleteNodeAsync(int id) { var response = new ListModelResponse <NodeViewModel>(); var nodeDataModel = false; try { nodeDataModel = await _nodeRepository.DeleteNode(id); if (nodeDataModel) { // response.Message = String.Format("Record Deleted Successfully"); response.Message = Messages.SuccessMsg; } else { //response.Message = String.Format("Record Deletion failed"); response.Message = Messages.FailMsg; } } catch (Exception ex) { response.DidError = true; response.ErrorMessage = ex.Message; } return(response.Message); }
public int DeleteNode(string id) { logger.LogInformation($"Removing node id={id}"); var node = nodeRepository.GetNode(id); if (node != null) { eventBus.Publish(new NodeDeletedEvent() { CreationDate = clock.UtcNow(), DeletedNode = node }); } return(nodeRepository.DeleteNode(id)); }
public JsonResult DeleteNode(int id) { _nodeRepository.DeleteNode(id); return(Json(new { success = true, nodeId = id })); }