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()); }
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 }); }