/// <summary>
		/// Executes the index creation against the specified document database using the specified conventions
		/// </summary>
		public virtual void Execute(IDatabaseCommands databaseCommands, DocumentConvention documentConvention)
		{
			Conventions = documentConvention;
			var transformerDefinition = CreateTransformerDefinition();
			// This code take advantage on the fact that RavenDB will turn an index PUT
			// to a noop of the index already exists and the stored definition matches
			// the new definition.
			databaseCommands.PutTransformer(TransformerName, transformerDefinition);

			UpdateIndexInReplication(databaseCommands, documentConvention, (commands, url) =>
				commands.PutTransformer(TransformerName, transformerDefinition));
		}
Example #2
0
        /// <summary>
        /// Executes the index creation against the specified document database using the specified conventions
        /// </summary>
        public virtual void Execute(IDatabaseCommands databaseCommands, DocumentConvention documentConvention)
        {
            Conventions = documentConvention;
            var transformerDefinition = CreateTransformerDefinition(documentConvention.PrettifyGeneratedLinqExpressions);

            // This code take advantage on the fact that RavenDB will turn an index PUT
            // to a noop of the index already exists and the stored definition matches
            // the new definition.
            databaseCommands.PutTransformer(TransformerName, transformerDefinition);

            UpdateIndexInReplication(databaseCommands, documentConvention, (commands, url) =>
                                     commands.PutTransformer(TransformerName, transformerDefinition));
        }
Example #3
0
        /// <summary>
        /// Executes the index creation against the specified document database using the specified conventions
        /// </summary>
        public virtual void Execute(IDatabaseCommands databaseCommands, DocumentConvention documentConvention)
        {
            Conventions = documentConvention;
            var transformerDefinition = CreateTransformerDefinition(documentConvention.PrettifyGeneratedLinqExpressions);

            // This code take advantage on the fact that RavenDB will turn an index PUT
            // to a noop of the index already exists and the stored definition matches
            // the new definition.
            databaseCommands.PutTransformer(TransformerName, transformerDefinition);

            if (documentConvention.IndexAndTransformerReplicationMode.HasFlag(IndexAndTransformerReplicationMode.Transformers))
            {
                ReplicateTransformerIfNeeded(databaseCommands);
            }
        }
Example #4
0
 public Task <string> PutTransformerAsync(string name, TransformerDefinition transformerDefinition)
 {
     return(new CompletedTask <string>(databaseCommands.PutTransformer(name, transformerDefinition)));
 }