public ExecuteAsyncResult(InstancePersistenceContext context, InstancePersistenceCommand command, TimeSpan timeout) : this(command, timeout, null, null) { this.context = context; this.priorAsyncResult = this.context.LastAsyncResult; this.priorAsyncResult.executeCalledByCurrentCommand = true; bool flag = false; try { this.context.LastAsyncResult = this; this.RunLoopCore(true); flag = true; } finally { this.context.LastAsyncResult = this.priorAsyncResult; if (!flag && this.context.IsHandleDoomedByRollback) { this.context.InstanceHandle.Free(); } } base.Complete(true); }
public ExecuteAsyncResult(InstancePersistenceContext context, InstancePersistenceCommand command, TimeSpan timeout, AsyncCallback callback, object state) : this(command, timeout, callback, state) { this.context = context; this.priorAsyncResult = this.context.LastAsyncResult; this.priorAsyncResult.executeCalledByCurrentCommand = true; base.OnCompleting = new Action<AsyncResult, Exception>(this.SimpleCleanup); bool flag = false; bool flag2 = false; try { this.context.LastAsyncResult = this; if (this.RunLoop()) { flag = true; } flag2 = true; } finally { if (!flag2) { this.context.LastAsyncResult = this.priorAsyncResult; } } if (flag) { base.Complete(true); } }