Example #1
0
        private static void Main()
        {
            try
            {
                using (var client = new AmazonDynamoDBClient())
                {
                    //client.CreateExampleTable(TableName);

                    using (var context = new DynamoDBContext(client))
                    {
                        // Sample queries.
                        //context.FindRepliesInLastNDays(3000);
                        context.FindRepliesPostedWithinTimePeriod(0, 3000);

                        for (var index = 1; index <= 2; index++)
                        {
                            // context.CreateBookItem(index);
                            //context.RetrieveBook(index);

                            //Couple of sample updates.
                            //context.UpdateMultipleAttributes(index);
                            //context.UpdateBookPriceConditionally(index);

                            //Delete
                            //context.DeleteBook(index);
                        }
                    }
                }

                Console.WriteLine("To continue, press Enter");
                Console.ReadLine();
            }
            catch (AmazonDynamoDBException e) { Console.WriteLine(e.Message); }
            catch (AmazonServiceException e) { Console.WriteLine(e.Message); }
            catch (Exception e) { Console.WriteLine(e.Message); }
        }