Amazon.DynamoDBv2.DocumentModel.Table.LoadTable C# (CSharp) Method

LoadTable() public static method

Creates a Table object with the specified name, using the passed-in client to load the table definition. The returned table will use the conversion specified by AWSConfigs.DynamoDBConfig.ConversionSchema This method will throw an exception if the table does not exist.
public static LoadTable ( IAmazonDynamoDB ddbClient, string tableName ) : Table
ddbClient IAmazonDynamoDB Client to use to access DynamoDB.
tableName string Name of the table.
return Table
        public static Table LoadTable(IAmazonDynamoDB ddbClient, string tableName)
        {
            return LoadTable(ddbClient, tableName, DynamoDBEntryConversion.CurrentConversion);
        }

Same methods

Table::LoadTable ( IAmazonDynamoDB ddbClient, string tableName, DynamoDBEntryConversion conversion ) : Table
Table::LoadTable ( IAmazonDynamoDB ddbClient, string tableName, Table consumer, DynamoDBEntryConversion conversion ) : Table

Usage Example

Example #1
0
        public static List <Document> GetAllDocumentsWithFilter(string tableName, string columnName, string filterValue)
        {
            try
            {
                AmazonDynamoDBClient client = new AmazonDynamoDBClient(MyAWSConfigs.DynamodbRegion);

                Table table = Table.LoadTable(client, tableName);

                ScanFilter scanFilter = new ScanFilter();
                scanFilter.AddCondition(columnName, ScanOperator.Equal, filterValue);

                Search          search = table.Scan(scanFilter);
                List <Document> docs   = new List <Document>();
                do
                {
                    docs.AddRange(search.GetNextSet().ToList <Document>());
                } while (!search.IsDone);

                var temp = docs.ToList <Document>();

                client.Dispose();

                return(temp);
            }
            catch (AmazonDynamoDBException e)
            {
                Console.WriteLine("AmazonDynamoDBException: " + e);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: " + e);
            }

            return(null);
        }
All Usage Examples Of Amazon.DynamoDBv2.DocumentModel.Table::LoadTable