private static async Task <ProcessadorResult> ProcessarListagem(LuisResult result, BotData userData) { List <IAzureItem> resources; var subscriptionId = userData.GetProperty <string>("SUBSCRIPTION"); var applicationId = userData.GetProperty <string>("APPLICATIONID"); var secretKey = userData.GetProperty <string>("SECRETKEY"); if (result.Entities.Any(v => v.Type.ToUpper() == "TODOSRECURSOS")) { resources = await ActionBuilder.ListResources(subscriptionId, applicationId, secretKey); userData.SetProperty("RESOURCES", resources); } else { resources = await ActionBuilder.ListResourceGroups(subscriptionId, applicationId, secretKey); userData.SetProperty("RESOURCEGROUPS", resources); } var mensagemResult = new StringBuilder(); if (resources.Any()) { mensagemResult.AppendLine(resources[0].GetType().Name); } foreach (var azureResource in resources) { mensagemResult.AppendLine($"* {azureResource}"); } return(new ProcessadorResult { Processado = true, Mensagem = mensagemResult.ToString() }); }