Example #1
0
        public void AddRegistryEntry(Tvq tvq)
        {
            // Create the table client.
            var tableClient = m_StorageAccount.CreateCloudTableClient();

            // Create the table if it doesn't exist.
            var table = tableClient.GetTableReference("registryentries");
            table.CreateIfNotExists();

            var tvqEntity = new TvqEntity(m_PartitionKey, tvq);
            var insertOperation = TableOperation.Insert(tvqEntity);

            // Execute the insert operation.
            table.Execute(insertOperation);
        }
Example #2
0
        public void AddRegistryEntry(Tvq tvq)
        {
            // Create the table client.
            var tableClient = m_StorageAccount.CreateCloudTableClient();

            // Create the table if it doesn't exist.
            var table = tableClient.GetTableReference("registryentries");

            table.CreateIfNotExists();

            var tvqEntity       = new TvqEntity(m_PartitionKey, tvq);
            var insertOperation = TableOperation.Insert(tvqEntity);

            // Execute the insert operation.
            table.Execute(insertOperation);
        }
Example #3
0
        /// <summary>
        /// Deletes an entry
        /// </summary>
        /// <param name="t"></param>
        /// <returns>True if successful</returns>
        public bool DeleteRegistryEntry(DateTime t)
        {
            // Create the table client.
            var tableClient = m_StorageAccount.CreateCloudTableClient();

            // Create the table if it doesn't exist.
            var table = tableClient.GetTableReference("registryentries");
            table.CreateIfNotExists();

            var entity = new TvqEntity(m_PartitionKey, new Tvq(t, 0, Quality.Ok))
            {
                ETag = "*"
            };
            var deleteOperation = TableOperation.Delete(entity);
            var result = table.Execute(deleteOperation);
            var ok = result.HttpStatusCode == (int)HttpStatusCode.NoContent;
            return ok;
        }
Example #4
0
        /// <summary>
        /// Deletes an entry
        /// </summary>
        /// <param name="t"></param>
        /// <returns>True if successful</returns>
        public bool DeleteRegistryEntry(DateTime t)
        {
            // Create the table client.
            var tableClient = m_StorageAccount.CreateCloudTableClient();

            // Create the table if it doesn't exist.
            var table = tableClient.GetTableReference("registryentries");

            table.CreateIfNotExists();

            var entity = new TvqEntity(m_PartitionKey, new Tvq(t, 0, Quality.Ok))
            {
                ETag = "*"
            };
            var deleteOperation = TableOperation.Delete(entity);
            var result          = table.Execute(deleteOperation);
            var ok = result.HttpStatusCode == (int)HttpStatusCode.NoContent;

            return(ok);
        }