public roleactions AddAction(roleactions role) { System.Console.WriteLine("### Ravish in AddAction function"); System.Console.WriteLine(role); _actions.InsertOne(role); return(role); }
public roleactions UpdateAction(roleactions role) { System.Console.WriteLine("### Ravish in UpdateAction function"); System.Console.WriteLine(role); _actions.ReplaceOne(r => r._id == role._id, role); return(role); }
public void RecurseForRootElement(roleactions element, List <roleactions> allElements) { var childElements = allElements.FindAll(a => a.parent == element.action); if (childElements != null) { element.childactions = childElements; for (int j = 0; j < element.childactions.Count(); j++) { RecurseForRootElement(element.childactions[j], allElements); } } }
public IActionResult updateAction([FromBody] roleactions newAction) { var _action = _userService.UpdateAction(newAction); if (_action == null) { return(BadRequest(new { message = "there is a problem with data in actions" })); } else { return(Ok(_action)); } }