public void DeleteSearch(Guid searchId) { var entity = _tableStorageProvider.GetEntity <SearchEntity>(SearchEntity.AllUsersPk, searchId.ToString()); if (entity == null) { throw new Exception("No such search " + searchId); } if (entity.InputContainer != null) { _blobStorageProvider.DeleteContainer(entity.InputContainer); } if (entity.OutputContainer != null) { _blobStorageProvider.DeleteContainer(entity.OutputContainer); } if (entity.JobId != null) { try { _batchClient.JobOperations.DeleteJob(entity.JobId); } catch (BatchException be) { if (be.RequestInformation.HttpStatusCode != HttpStatusCode.NotFound) { throw; } } } var queries = _tableStorageProvider.ListEntities <SearchQueryEntity>(entity.RowKey); if (queries != null) { Parallel.ForEach(queries, q => { _tableStorageProvider.DeleteEntity(q); }); } _tableStorageProvider.DeleteEntity(entity); }
public void DeleteAnalysis(Guid analysisId) { var entity = _tableStorageProvider.GetEntity <AnalysisEntity>(AnalysisEntity.AllUsersPk, analysisId.ToString()); if (entity == null) { throw new Exception("No such analysis " + analysisId); } if (entity.InputContainer != null) { _blobStorageProvider.DeleteContainer(entity.InputContainer); } if (entity.OutputContainer != null) { _blobStorageProvider.DeleteContainer(entity.OutputContainer); } if (entity.JobId != null) { try { _batchClient.JobOperations.DeleteJob(entity.JobId); } catch (BatchException be) { if (be.RequestInformation.HttpStatusCode != HttpStatusCode.NotFound) { throw; } } } _tableStorageProvider.DeleteEntity(entity); }