Пример #1
0
        public roleactions AddAction(roleactions role)
        {
            System.Console.WriteLine("### Ravish in AddAction function");
            System.Console.WriteLine(role);

            _actions.InsertOne(role);
            return(role);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
                }
            }
        }
Пример #4
0
        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));
            }
        }