public static void DeleteContentProtections(TableClient tableClient, string jobId) { string tableName = Constant.Storage.Table.ContentProtection; ContentProtection[] contentProtections = tableClient.GetEntities <ContentProtection>(tableName, jobId); tableClient.DeleteEntities(tableName, contentProtections); }
public static void PurgePublishContent(TableClient tableClient) { string tableName = Constant.Storage.Table.ContentPublish; MediaPublish[] contentPublishes = tableClient.GetEntities <MediaPublish>(tableName); foreach (MediaPublish contentPublish in contentPublishes) { string jobId = contentPublish.RowKey; MediaClient mediaClient = new MediaClient(contentPublish.MediaAccount); IJob job = mediaClient.GetEntityById(MediaEntity.Job, jobId) as IJob; if (job == null) { tableClient.DeleteEntity(tableName, contentPublish); DeleteContentProtections(tableClient, contentPublish.RowKey); } } }