Raven.Client.Indexes.AbstractTransformerCreationTask.Execute C# (CSharp) Метод

Execute() публичный Метод

Executes the index creation against the specified document database using the specified conventions
public Execute ( IDatabaseCommands databaseCommands, DocumentConvention documentConvention ) : void
databaseCommands IDatabaseCommands
documentConvention Raven.Client.Document.DocumentConvention
Результат void
		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.DirectPutTransformer(TransformerName, url, transformerDefinition));
		}
#endif

Same methods

AbstractTransformerCreationTask::Execute ( IDocumentStore store ) : void

Usage Example

Пример #1
0
		/// <summary>
		/// Executes the transformer creation
		/// </summary>
		public virtual void ExecuteTransformer(AbstractTransformerCreationTask transformerCreationTask)
		{
			transformerCreationTask.Execute(DatabaseCommands, Conventions);
		}
All Usage Examples Of Raven.Client.Indexes.AbstractTransformerCreationTask::Execute