Exemple #1
0
        private async Task AddItemAsync()
        {
            TableHandler <Item> requestHandler = new TableHandler <Item>(TableName, new ItemConverterItem());

            List <Item> items = new List <Item>()
            {
                new Item()
                {
                    id = "1", number = 11
                },
                new Item()
                {
                    id = "2", number = 22
                },
                new Item()
                {
                    id = "3", number = 33
                }
            };

            await requestHandler.AddItemAsync(items[0]);

            await requestHandler.AddItemAsync(items[1]);

            await requestHandler.AddItemAsync(items[2]);

            Console.WriteLine("Added Item");
        }
Exemple #2
0
        private async Task ClasstimeAddItem()
        {
            TableHandler <Classtime> requestHandler = new TableHandler <Classtime>(TableNameClasstime, new ItemConverterClasstime());

            List <Classtime> items = new List <Classtime>()
            {
                new Classtime()
                {
                    id = "1", classCode = "CS455", building = "L", roomNumber = "218", day = "Monday", startTime = 1630, endTime = 1720
                }
            };

            await requestHandler.AddItemAsync(items[0]);

            Console.WriteLine("Added Item");
        }
Exemple #3
0
        private async Task RemakeTableAsync()
        {
            TableHandler <Item> requestHandler = new TableHandler <Item>(TableName, new ItemConverterItem());

            await requestHandler.DeleteTableAsync();

            await requestHandler.WaitTillTableExists(false);

            Console.WriteLine("Table Doesn't Exist Anymore");

            await requestHandler.CreateTableAsync();

            await requestHandler.WaitTillTableIsStatus(TableStatus.ACTIVE);

            Console.WriteLine("Table Is Active");

            Item item = new Item()
            {
                id = "idfoo", number = 430
            };
            await requestHandler.AddItemAsync(item);

            Console.WriteLine("Items Added");
        }