Пример #1
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;
     }
 }
Пример #2
0
 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;
     }
 }
Пример #3
0
 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;
     }
 }
Пример #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]));
 }
Пример #5
0
 private static bool Contains(IDocumentCollection <FriendDocument> friends, string swid)
 {
     return(friends.FindDocumentIdsEqual(FriendDocument.SwidFieldName, swid).Any());
 }
Пример #6
0
 private static IEnumerable <uint> EnumerateFriendDocumentIds(IDocumentCollection <FriendDocument> friends, string swid)
 {
     return(friends.FindDocumentIdsEqual(FriendDocument.SwidFieldName, swid));
 }