Skip to content

Instantly share code, notes, and snippets.

@celston celston/AsyncCommand.cs
Last active Jul 7, 2017

What would you like to do?
public abstract class AsyncCommand : Command
public override void Execute(CommandContext context)
if (context == null)
Context.ClientPage.Start(this, "Run", PrepareArgs(context));
catch (Exception ex)
Sitecore.Diagnostics.Log.Error(ex.Message, ex, this);
protected virtual NameValueCollection PrepareArgs(CommandContext context)
var item = context.Items[0];
var args = new NameValueCollection()
{ "id", item.ID.ToString() },
{ "language", item.Language.ToString() },
{ "version", item.Version.ToString() },
return args;
protected abstract void Run(ClientPipelineArgs args);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.