示例#1
0
        private void CreateKeyValues(Action <IDocumentCollection <KeyValueDocument> > operation)
        {
            string dirPath = directoryCreator.CreateSdkDirectory("KeyValues");

            try
            {
                using (IDocumentCollection <KeyValueDocument> documentCollection = documentCollectionFactory.CreateHighSecurityFileSystemCollection <KeyValueDocument>(dirPath, encryptionKey))
                {
                    databaseCorruptionHandler.Add(documentCollection);
                    operation(documentCollection);
                    databaseCorruptionHandler.Remove(documentCollection);
                }
            }
            catch (CorruptionException ex)
            {
                databaseCorruptionHandler.HandleCorruption(ex);
                throw;
            }
        }
示例#2
0
 private AlertDocument GetAlertDocument(long alertId)
 {
     try
     {
         return((from id in alerts.FindDocumentIdsEqual(AlertDocument.AlertIdFieldName, alertId)
                 select alerts.Find(id)).FirstOrDefault());
     }
     catch (CorruptionException ex)
     {
         databaseCorruptionHandler.HandleCorruption(ex);
         throw;
     }
 }