public WorkflowDefinitionExtension(string definitionPath, string connectionString)
     : this(connectionString)
 {
     this.definitionInfo = new WorkflowDefinitionInfo {
         Path = definitionPath
     };
 }
            public SaveAsyncResult(Guid id, string workflowInstanceStatus, WorkflowDefinitionInfo definitionInfo, string connectionString, TimeSpan timeout, AsyncCallback callback, object state)
                : base(callback, state)
            {
                this.definitionInfo = definitionInfo;

                if (handleEndExecuteNonQuery == null)
                {
                    handleEndExecuteNonQuery = new AsyncCompletion(HandleEndExecuteNonQuery);
                }

                this.connection = new SqlConnection(connectionString);
                if (!StatusIsComplete(workflowInstanceStatus))
                {
                    this.command = BuildAssociateDefinitionCommand(this.connection, id, this.definitionInfo.Path);
                }
                else
                {
                    this.command = BuildDeleteDefinitionCommand(this.connection, id);
                }
                this.connection.Open();

                IAsyncResult result = command.BeginExecuteNonQuery(PrepareAsyncCompletion(handleEndExecuteNonQuery), this);

                if (result.CompletedSynchronously)
                {
                    if (HandleEndExecuteNonQuery(result))
                    {
                        Complete(true);
                    }
                }
            }
 public WorkflowDefinitionExtension(string definitionPath, string connectionString)
     : this(connectionString)
 {
     this.definitionInfo = new WorkflowDefinitionInfo { Path = definitionPath };
 }
            public SaveAsyncResult(Guid id, string workflowInstanceStatus, WorkflowDefinitionInfo definitionInfo, string connectionString, TimeSpan timeout, AsyncCallback callback, object state)
                : base(callback, state)
            {
                this.definitionInfo = definitionInfo;

                if (handleEndExecuteNonQuery == null)
                {
                    handleEndExecuteNonQuery = new AsyncCompletion(HandleEndExecuteNonQuery);
                }

                this.connection = new SqlConnection(connectionString);
                if (!StatusIsComplete(workflowInstanceStatus))
                {
                    this.command = BuildAssociateDefinitionCommand(this.connection, id, this.definitionInfo.Path);
                }
                else
                {
                    this.command = BuildDeleteDefinitionCommand(this.connection, id);
                }
                this.connection.Open();

                IAsyncResult result = command.BeginExecuteNonQuery(PrepareAsyncCompletion(handleEndExecuteNonQuery), this);

                if (result.CompletedSynchronously)
                {
                    if (HandleEndExecuteNonQuery(result))
                    {
                        Complete(true);
                    }
                }
            }