示例#1
0
        /// <summary>
        /// A simple function that takes a string and does a ToUpper
        /// </summary>
        /// <param name="input"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public APIGatewayProxyResponse FunctionHandler(APIGatewayProxyRequest request, ILambdaContext context)
        {
            context.Logger.Log("Starting Total Get call");

            using (AwsFactory factory = new AwsFactory(context.Logger))
            {
                string userId    = request.PathParameters["userId"];
                string firstName = request.PathParameters["firstName"];

                context.Logger.LogLine($"userId=\"{userId}\"");
                context.Logger.LogLine($"firstName=\"{firstName}\"");

                using (GetTotal getTotal = new GetTotal(factory))
                {
                    string jsonResponse = getTotal.Retrieve(userId, firstName);

                    context.Logger.LogLine($"Response: {jsonResponse}");
                    APIGatewayProxyResponse response = new APIGatewayProxyResponse()
                    {
                        Body       = jsonResponse,
                        StatusCode = 200
                    };

                    return(response);
                }
            }
        }
示例#2
0
        public IList Properties()
        {
            ArrayList l = new ArrayList();

            l.Add(GetTotal.ToString("c"));

            return(l);
        }