Esempio n. 1
0
        public async Task <ActionResult <List <IndexFileList> > > GetTaxonomies()
        {
            try
            {
                string          storageAccount  = Common.Helpers.Common.GetStorageKey(Request);
                IndexManagement im              = new IndexManagement(storageAccount);
                string          responseMessage = await im.GetTaxonomies();

                List <IndexFileList> indexParms = JsonConvert.DeserializeObject <List <IndexFileList> >(responseMessage);
                //List<string> files = indexParms.Select(item => item.Name).ToList();
                return(indexParms);
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
        public static async Task <IActionResult> Taxonomies(
            [HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req,
            ILogger log)
        {
            log.LogInformation("GetTaxonomies: Starting");
            string responseMessage = "";

            try
            {
                string          storageAccount = Common.Helpers.Common.GetStorageKey(req);
                IndexManagement im             = new IndexManagement(storageAccount);
                responseMessage = await im.GetTaxonomies();
            }
            catch (Exception ex)
            {
                log.LogError($"GetTaxonomies: {ex}");
                return(new BadRequestObjectResult($"Error getting taxonomies: {ex}"));
            }

            log.LogInformation("GetTaxonomies: Complete");
            return(new OkObjectResult(responseMessage));
        }