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); }
/// <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; }
/// <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); }