Ejemplo n.º 1
0
        private async Task <int> OnExecuteAsync(CommandLineApplication app, IApplicationLifetime applicationLifetime, ILogger <Program> logger)
        {
            var tmp      = await new HttpClient().GetStringAsync("https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-function-app-create-dynamic/azuredeploy.json");
            var document = JToken.Parse(tmp);
            var factory  = new ConsolePrintExpressionFunctionFactory();
            var ex       = new ExpressionParser <JToken>(Options.Create(new ExpressionParserOptions <JToken> {
                ThrowOnError = false, Document = document
            }), logger, factory);

            await Recursive(ex, document);

            foreach (var function in factory.FoundFunctions)
            {
                Console.WriteLine(function);
            }
            Console.WriteLine("Parameters:");
            foreach (var function in factory.Parameters)
            {
                Console.WriteLine(function);
            }
            return(0);
        }
Ejemplo n.º 2
0
 public ConsolePrintExpressionFunction(ConsolePrintExpressionFunctionFactory consolePrintExpressionFunctionFactory, string name)
 {
     this.consolePrintExpressionFunctionFactory = consolePrintExpressionFunctionFactory;
     this.name = name ?? throw new ArgumentNullException(nameof(name));
 }