Ejemplo n.º 1
0
        public async Task <List <Item> > GetHandler(ILambdaContext context)
        {
            var tableName = Environment.GetEnvironmentVariable(TableName);

            context.Logger.LogLine($"Using table {tableName}");

            var repository = new DynamoDbRepository(tableName);

            return(await repository.GetItems());
        }
Ejemplo n.º 2
0
        public async Task <Result> DeleteHandler(string id, ILambdaContext context)
        {
            var tableName = Environment.GetEnvironmentVariable(TableName);

            context.Logger.LogLine($"Using table {tableName}");

            var repository = new DynamoDbRepository(tableName);

            var result = await repository.RemoveItem(id);

            context.Logger.LogLine($"Result = {result}");

            return(new Result {
                Success = result
            });
        }