private async Task DeleteAllTablesAsync() { if (DynamoDbClient != null) { var tables = await DynamoDbClient.ListTablesAsync(); foreach (var tableName in tables.TableNames) { await DynamoDbClient.DeleteTableAsync(tableName); } } }
/// <summary> /// Clean the database and fullfill with inicialdata /// (only if is develop, integration and testing environment) /// </summary> /// <param name="query">name of file separetd with ','</param> /// <returns>Result from the operation in a message</returns> public override bool ResetData(string query) { DynamoDbClient.ListTablesAsync().Result.TableNames.ForEach(async x => { var request = new DeleteTableRequest { TableName = x }; await DynamoDbClient.DeleteTableAsync(request); }); return(true); }