public void Test04()
 {
     Credentials credentials = new Credentials(ACCOUNT_NAME, KEY);
     DynamicTableContext context = new DynamicTableContext(TABLE_NAME, credentials);
     dynamic item = new { PartitionKey = "1", RowKey = Guid.NewGuid().ToString(), Value = "Hello World" };
     context.InsertOrReplace(item);
 }
        public void Test09()
        {
            Credentials         credentials = new Credentials(ACCOUNT_NAME, KEY);
            DynamicTableContext context     = new DynamicTableContext(TABLE_NAME, credentials);
            dynamic             item        = context.Get("1", "999"); // item does not exist

            Assert.IsNull(item);
        }
 public void Setup()
 {
     var account = new CloudStorageAccount(new StorageCredentialsAccountAndKey(ACCOUNT_NAME, KEY), false);
     var tableClient = account.CreateCloudTableClient();
     tableClient.CreateTableIfNotExist(TABLE_NAME);
     var context = new DynamicTableContext(TABLE_NAME, new Credentials(ACCOUNT_NAME, KEY));
     context.InsertOrReplace(new { PartitionKey = "1", RowKey = "1", Value1 = "TEST" });
 }
        public void Test04()
        {
            Credentials         credentials = new Credentials(ACCOUNT_NAME, KEY);
            DynamicTableContext context     = new DynamicTableContext(TABLE_NAME, credentials);
            dynamic             item        = new { PartitionKey = "1", RowKey = Guid.NewGuid().ToString(), Value = "Hello World" };

            context.InsertOrReplace(item);
        }
        public void Test08()
        {
            Credentials         credentials = new Credentials(ACCOUNT_NAME, KEY);
            DynamicTableContext context     = new DynamicTableContext(TABLE_NAME, credentials);
            dynamic             item        = new { PartitionKey = "1", RowKey = "1", Value = "Hello World" };

            context.Insert(item);
        }
 public void Test02()
 {
     Credentials credentials = new Credentials(ACCOUNT_NAME, KEY);
     DynamicTableContext context = new DynamicTableContext(TABLE_NAME, credentials);
     dynamic item = context.Get("1", "1");
     Assert.IsNotNull(item);
     Assert.AreEqual("1", item.PartitionKey);
     Assert.AreEqual("1", item.RowKey);
 }
 public void Test05()
 {
     Credentials credentials = new Credentials(ACCOUNT_NAME, KEY);
     DynamicTableContext context = new DynamicTableContext(TABLE_NAME, credentials);
     dynamic item = new ExpandoObject();
     item.PartitionKey = "1";
     item.RowKey = Guid.NewGuid().ToString();
     item.Value = "Hello World";
     context.Insert(item);
 }
        public void Setup()
        {
            var account     = new CloudStorageAccount(new StorageCredentialsAccountAndKey(ACCOUNT_NAME, KEY), false);
            var tableClient = account.CreateCloudTableClient();

            tableClient.CreateTableIfNotExist(TABLE_NAME);
            var context = new DynamicTableContext(TABLE_NAME, new Credentials(ACCOUNT_NAME, KEY));

            context.InsertOrReplace(new { PartitionKey = "1", RowKey = "1", Value1 = "TEST" });
        }
        public void Test02()
        {
            Credentials         credentials = new Credentials(ACCOUNT_NAME, KEY);
            DynamicTableContext context     = new DynamicTableContext(TABLE_NAME, credentials);
            dynamic             item        = context.Get("1", "1");

            Assert.IsNotNull(item);
            Assert.AreEqual("1", item.PartitionKey);
            Assert.AreEqual("1", item.RowKey);
        }
        public void Test07()
        {
            Credentials         credentials = new Credentials(ACCOUNT_NAME, KEY);
            DynamicTableContext context     = new DynamicTableContext(TABLE_NAME, credentials);
            var dictionary = new Dictionary <string, object>();

            dictionary["PartitionKey"] = "2";
            dictionary["RowKey"]       = "2";
            dictionary["Value3"]       = "FooBar";
            context.InsertOrReplace(dictionary);
        }
        public void Test06()
        {
            Credentials         credentials = new Credentials(ACCOUNT_NAME, KEY);
            DynamicTableContext context     = new DynamicTableContext(TABLE_NAME, credentials);
            dynamic             item        = new ExpandoObject();

            item.PartitionKey = "1";
            item.RowKey       = Guid.NewGuid().ToString();
            item.Value        = "Hello World";
            context.InsertOrMerge(item);
        }
 public void Test01()
 {
     Credentials credentials = new Credentials(ACCOUNT_NAME, KEY);
     DynamicTableContext context = new DynamicTableContext(TABLE_NAME, credentials);
     foreach (IDictionary<string, object> item in context.Query("Value1 eq 'TEST'"))
     {
         foreach (string key in item.Keys)
         {
             Console.WriteLine(key + " = " + item[key]);
         }
     }
 }
        public void Test01()
        {
            Credentials         credentials = new Credentials(ACCOUNT_NAME, KEY);
            DynamicTableContext context     = new DynamicTableContext(TABLE_NAME, credentials);

            foreach (IDictionary <string, object> item in context.Query("Value1 eq 'TEST'"))
            {
                foreach (string key in item.Keys)
                {
                    Console.WriteLine(key + " = " + item[key]);
                }
            }
        }
 public void Test07()
 {
     Credentials credentials = new Credentials(ACCOUNT_NAME, KEY);
     DynamicTableContext context = new DynamicTableContext(TABLE_NAME, credentials);
     var dictionary = new Dictionary<string, object>();
     dictionary["PartitionKey"] = "2";
     dictionary["RowKey"] = "2";
     dictionary["Value3"] = "FooBar";
     context.InsertOrReplace(dictionary);
 }
 public void Test09()
 {
     Credentials credentials = new Credentials(ACCOUNT_NAME, KEY);
     DynamicTableContext context = new DynamicTableContext(TABLE_NAME, credentials);
     dynamic item = context.Get("1", "999"); // item does not exist
     Assert.IsNull(item);
 }
 public void Test00()
 {
     var context = new DynamicTableContext(null, null);
 }
 public void Test00()
 {
     var context = new DynamicTableContext(null, null);
 }
 public void Test08()
 {
     Credentials credentials = new Credentials(ACCOUNT_NAME, KEY);
     DynamicTableContext context = new DynamicTableContext(TABLE_NAME, credentials);
     dynamic item = new { PartitionKey = "1", RowKey = "1", Value = "Hello World" };
     context.Insert(item);
 }