Exemplo n.º 1
0
        private void HandleDeleteRequest(MongoDeleteMessage request)
        {
            _querySynchronizer.StartBlockingAction();

            try
            {
                var changes = MongoMessageHandler.GetChanges(request);
                SendRequestToServer(request);

                var checkErrorRequest = ReadClientRequest();
                if (checkErrorRequest.GetType() != typeof(MongoQueryMessage) &&
                    !MessageDataExtractor.IsHasErrorRequest(checkErrorRequest))
                {
                    //TODO: throw error. Und format
                }

                SendRequestToServer(checkErrorRequest);
                var hasErrorResponse = ReadServerResponse();

                if (!MessageDataExtractor.IsHasError(hasErrorResponse))
                {
                    MongoMessageHandler.ApplyDeleteChanges(changes);
                }

                SendResponseToClient(hasErrorResponse);
            }
            catch (Exception)
            {
                //TODO:
                throw;
            }
            finally
            {
                _querySynchronizer.StopBlockingAction();
            }
        }
Exemplo n.º 2
0
 public static List<ReferencePack> GetChanges(MongoDeleteMessage request)
 {
     return DataProviderFactory.GetDataProvider().Read(request.FullCollectionName, request.Document);
 }