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;
     }
 }
 public UserDocument GetUserBySwid(string swid)
 {
     try
     {
         return((swid == null) ? null : (from id in users.FindDocumentIdsEqual(UserDocument.SwidFieldName, swid)
                                         select users.Find(id)).FirstOrDefault());
     }
     catch (CorruptionException ex)
     {
         databaseCorruptionHandler.HandleCorruption(ex);
         throw;
     }
 }
 public void DeleteFriendInvitation(long invitationId)
 {
     try
     {
         uint[] array  = friendInvitations.FindDocumentIdsEqual(FriendInvitationDocument.FriendInvitationIdFieldName, invitationId).ToArray();
         uint[] array2 = array;
         foreach (uint documentId in array2)
         {
             friendInvitations.Delete(documentId);
         }
     }
     catch (CorruptionException ex)
     {
         databaseCorruptionHandler.HandleCorruption(ex);
         throw;
     }
 }
Exemple #4
0
 private static uint?GetSessionDocumentId(string swid, IDocumentCollection <SessionDocument> sessions)
 {
     uint[] array = sessions.FindDocumentIdsEqual(SessionDocument.SwidFieldName, swid).ToArray();
     return((array.Length == 0) ? null : new uint?(array[0]));
 }
 private static bool Contains(IDocumentCollection <FriendDocument> friends, string swid)
 {
     return(friends.FindDocumentIdsEqual(FriendDocument.SwidFieldName, swid).Any());
 }
 private static IEnumerable <uint> EnumerateFriendDocumentIds(IDocumentCollection <FriendDocument> friends, string swid)
 {
     return(friends.FindDocumentIdsEqual(FriendDocument.SwidFieldName, swid));
 }