internal static async Task AfterExecuteAsync(string indexName, ScriptedIndexResults scripts, CancellationToken token)
        {
            throw new NotImplementedException();

            /*var documentId = GetScriptedIndexResultsDocumentId(indexName);
             * scripts.Id = documentId;
             *
             * var oldDocument = await asyncDatabaseCommands.GetAsync(documentId, token: token).ConfigureAwait(false);
             * var newDocument = RavenJObject.FromObject(scripts);
             * if (oldDocument != null && RavenJToken.DeepEquals(oldDocument.DataAsJson, newDocument))
             *  return;
             *
             * await asyncDatabaseCommands.PutAsync(documentId, null, newDocument, null, token).ConfigureAwait(false);
             * await asyncDatabaseCommands.ResetIndexAsync(indexName, token).ConfigureAwait(false);*/
        }
        internal static void AfterExecute(string indexName, ScriptedIndexResults scripts)
        {
            throw new NotImplementedException();

            /*var documentId = GetScriptedIndexResultsDocumentId(indexName);
             * scripts.Id = documentId;
             *
             * var oldDocument = databaseCommands.Get(documentId);
             * var newDocument = RavenJObject.FromObject(scripts);
             * if (oldDocument != null && RavenJToken.DeepEquals(oldDocument.DataAsJson, newDocument))
             *  return;
             *
             * databaseCommands.Put(documentId, null, newDocument, null);
             * databaseCommands.ResetIndex(indexName);*/
        }
		protected bool Equals(ScriptedIndexResults other)
		{
			return string.Equals(Id, other.Id) && string.Equals(IndexScript, other.IndexScript) && string.Equals(DeleteScript, other.DeleteScript);
		}
Ejemplo n.º 4
0
 protected bool Equals(ScriptedIndexResults other)
 {
     return(string.Equals(Id, other.Id) && string.Equals(IndexScript, other.IndexScript) && string.Equals(DeleteScript, other.DeleteScript));
 }
 protected AbstractScriptedIndexCreationTask()
 {
     scripts = new ScriptedIndexResults();
 }
Ejemplo n.º 6
0
        internal static async Task AfterExecuteAsync(IAsyncDatabaseCommands asyncDatabaseCommands, string indexName, ScriptedIndexResults scripts, CancellationToken token)
        {
            var documentId = GetScriptedIndexResultsDocumentId(indexName);

            scripts.Id = documentId;

            var oldDocument = await asyncDatabaseCommands.GetAsync(documentId, token).ConfigureAwait(false);

            var newDocument = RavenJObject.FromObject(scripts);

            if (oldDocument != null && RavenJToken.DeepEquals(oldDocument.DataAsJson, newDocument))
            {
                return;
            }

            await asyncDatabaseCommands.PutAsync(documentId, null, newDocument, null, token).ConfigureAwait(false);

            await asyncDatabaseCommands.ResetIndexAsync(indexName, token).ConfigureAwait(false);
        }
Ejemplo n.º 7
0
        internal static void AfterExecute(IDatabaseCommands databaseCommands, string indexName, ScriptedIndexResults scripts)
        {
            var documentId = GetScriptedIndexResultsDocumentId(indexName);

            scripts.Id = documentId;

            var oldDocument = databaseCommands.Get(documentId);
            var newDocument = RavenJObject.FromObject(scripts);

            if (oldDocument != null && RavenJToken.DeepEquals(oldDocument.DataAsJson, newDocument))
            {
                return;
            }

            databaseCommands.Put(documentId, null, newDocument, null);
            databaseCommands.ResetIndex(indexName);
        }