コード例 #1
0
        public async Task <IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
            ILogger log)
        {
            log.LogInformation("C# HTTP trigger function processed a request.");

            string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
            var    document    = JToken.Parse(requestBody);

            var factory = new ConsolePrintExpressionFunctionFactory();
            var ex      = new ExpressionParser <JToken>(Options.Create(new ExpressionParserOptions <JToken> {
                ThrowOnError = false, Document = document
            }), log, factory);

            Recursive(ex, document);

            return(new OkObjectResult(new { parameters = factory.Parameters, functions = factory.FoundFunctions }));
        }
コード例 #2
0
 public ConsolePrintExpressionFunction(ConsolePrintExpressionFunctionFactory consolePrintExpressionFunctionFactory, string name)
 {
     this.consolePrintExpressionFunctionFactory = consolePrintExpressionFunctionFactory;
     this.name = name ?? throw new ArgumentNullException(nameof(name));
 }