public virtual Task ExecuteAsync(IAsyncDatabaseCommands asyncDatabaseCommands, 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.
return asyncDatabaseCommands.PutTransformerAsync(TransformerName, transformerDefinition)
.ContinueWith(task => UpdateIndexInReplicationAsync(asyncDatabaseCommands, documentConvention, (client, url) =>
client.DirectPutTransformerAsync(TransformerName, transformerDefinition, url)))
.Unwrap();
}
}