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(); }
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)); }