public void AddAction(ResourceAction action)
        {
            var toAdd = new Persistance.Models.Action()
            {
                Category      = action.Category,
                Name          = action.Action,
                CanonicalName = action.ToString()
            };

            this.context.Add(toAdd);
            this.context.SaveChanges();
        }
Exemple #2
0
        public IActionResult Post([FromBody] ResourceAction resource)
        {
            var toAdd = new Persistance.Models.Action()
            {
                Category      = resource.Category,
                Name          = resource.Action,
                CanonicalName = resource.ToString()
            };

            this.context.Actions.Add(toAdd);
            this.context.SaveChanges();
            return(Ok(resource));
        }