public APIGatewayHttpApiV2ProxyResponse MultiplyFunctionHandler()

in playground/Lambda/WebCalculatorFunctions/Functions.cs [68:86]


    public APIGatewayHttpApiV2ProxyResponse MultiplyFunctionHandler(APIGatewayHttpApiV2ProxyRequest request, ILambdaContext context)
        => AWSLambdaWrapper.Trace(_traceProvider, (request, context) =>
        {
            var x = (int)Convert.ChangeType(request.PathParameters["x"], typeof(int));
            var y = (int)Convert.ChangeType(request.PathParameters["y"], typeof(int));
            var total = x * y;
            context.Logger.LogInformation($"Multipling {y} with {x} equals {total}");
            var response = new APIGatewayHttpApiV2ProxyResponse
            {
                StatusCode = 200,
                Headers = new Dictionary<string, string>
            {
                {"Content-Type", "application/json" }
            },
                Body = total.ToString()
            };

            return response;
        }, request, context);