public static async void deleteSiteToCapture(Model.SiteToCaptureEntity siteToCapture) { var config = GetConfig(); var storageAccount = CloudStorageAccount.Parse(config["StorageAccountConnectionString"]); CloudTableClient tableClient = storageAccount.CreateCloudTableClient(new TableClientConfiguration()); CloudTable table = tableClient.GetTableReference(config["SitesToCaptureTable"]); TableOperation insertOrMergeOperation = TableOperation.Delete(siteToCapture); TableResult result = await table.ExecuteAsync(insertOrMergeOperation); Model.SiteToCaptureEntity insertedCustomer = result.Result as Model.SiteToCaptureEntity; }
public static Model.SiteToCaptureEntity retrieveSiteToCapture(string siteId) { var config = GetConfig(); var storageAccount = CloudStorageAccount.Parse(config["StorageAccountConnectionString"]); CloudTableClient tableClient = storageAccount.CreateCloudTableClient(new TableClientConfiguration()); CloudTable table = tableClient.GetTableReference(config["SitesToCaptureTable"]); TableOperation retrieveOperation = TableOperation.Retrieve <Model.SiteToCaptureEntity>("", siteId); TableResult result = table.Execute(retrieveOperation); Model.SiteToCaptureEntity siteToCapture = result.Result as Model.SiteToCaptureEntity; return(siteToCapture); }
public static async void addSiteToCapture(string siteUrl, string siteId, string eventsToCapture, string captureToSiteId, string captureToListId) { var config = GetConfig(); var storageAccount = CloudStorageAccount.Parse(config["StorageAccountConnectionString"]); CloudTableClient tableClient = storageAccount.CreateCloudTableClient(new TableClientConfiguration()); CloudTable table = tableClient.GetTableReference(config["SitesToCaptureTable"]); var entity = new Model.SiteToCaptureEntity(HttpUtility.UrlEncode(siteUrl), siteId, eventsToCapture, captureToSiteId, captureToListId); TableOperation insertOrMergeOperation = TableOperation.InsertOrMerge(entity); TableResult result = await table.ExecuteAsync(insertOrMergeOperation); Model.SiteToCaptureEntity insertedCustomer = result.Result as Model.SiteToCaptureEntity; }