public ActionResult GetDocumentTypes() { if (!CheckCurrentPermission()) { return(Content(WsFactory.GetАccessDeniedHtmlFrom())); } var forms = MetaFormHelper.GetAvailableForSearch(); return(new ContentResult { ContentType = "text/html", Content = JsonSerializer.SerializeToString(forms.OrderBy(c => c.SearchWeight).OrderBy(c => c.Caption).Select(c => new { c.Id, Name = c.Caption, Weight = c.SearchWeight }).ToArray()) }); }