Exemple #1
0
        /// <summary>
        /// Saves all the changes to the Raven server.
        /// </summary>


        public void SaveChanges()
        {
            using (EntityToJson.EntitiesToJsonCachingScope())
            {
                var data = PrepareForSaveChanges();

                if (data.Commands.Count == 0)
                {
                    return;
                }
                IncrementRequestCount();
                LogBatch(data);

                var batchResults = DatabaseCommands.Batch(data.Commands);
                UpdateBatchResults(batchResults, data);
            }
        }
Exemple #2
0
        /// <summary>
        /// Saves all the changes to the Raven server.
        /// </summary>


        public void SaveChanges()
        {
            using (EntityToJson.EntitiesToJsonCachingScope())
            {
                var data = PrepareForSaveChanges();

                if (data.Commands.Count == 0)
                {
                    return;
                }
                IncrementRequestCount();
                LogBatch(data);

                var batchResults = DatabaseCommands.Batch(data.Commands);
                if (batchResults == null)
                {
                    throw new InvalidOperationException("Cannot call Save Changes after the document store was disposed.");
                }
                UpdateBatchResults(batchResults, data);
            }
        }