Esempio n. 1
0
        public IActionResult Actions()
        {
            // get actions
            var actions = manager
                          .GetActionsLiteral(Request.GetAuthentication())
                          .Where(i => !ExcludeActions.Contains(i.Key) && !string.IsNullOrEmpty(i.Key))
                          .OrderBy(i => i.Action.Name);

            // serialize results
            var value = JsonConvert.SerializeObject(actions, jsonSettings);

            // exit conditions
            if (!actions.Any())
            {
                return(NotFound());
            }

            // response
            return(new ContentResult
            {
                Content = value,
                ContentType = MediaTypeNames.Application.Json,
                StatusCode = HttpStatusCode.OK.ToInt32()
            });
        }
Esempio n. 2
0
        public IActionResult Actions()
        {
            // get actions
            var actions = manager
                          .GetActionsLiteral(Request.GetAuthentication())
                          .Where(i => !ExcludeActions.Contains(i.Model.Key) && !string.IsNullOrEmpty(i.Model.Key))
                          .OrderBy(i => i.Model.Action.Name);

            // exit conditions
            if (!actions.Any())
            {
                return(NotFound());
            }

            // response
            return(this.ContentResult(responseBody: actions));
        }