예제 #1
0
        public override async Task <APIGatewayProxyResponse> HandleRequestAsync(APIGatewayProxyRequest request, ILambdaContext context)
        {
            await _table.BatchDeleteMessagesAsync((await _table.ListMessagesAsync()).Select(m => m.MessageId));

            return(new APIGatewayProxyResponse()
            {
                Body = "ok",
                StatusCode = 200,
                IsBase64Encoded = false,
            });
        }
예제 #2
0
        public override async Task <APIGatewayProxyResponse> HandleRequestAsync(APIGatewayProxyRequest request, ILambdaContext context)
        {
            var messages = await _table.ListMessagesAsync();

            List <string> ids = new List <string>();

            foreach (var msg in messages)
            {
                LogInfo(msg.MessageId);
                ids.Add(msg.MessageId);
            }

            await _table.BatchDeleteMessagesAsync(ids);

            return(new APIGatewayProxyResponse {
                StatusCode = 200
            });
        }