internal WorkflowInstance(Guid instanceId, WorkflowRuntime runtime, WorkflowExecutionContext executionContext) { CodeContract.Requires(instanceId != Guid.Empty); CodeContract.Requires(runtime != null); CodeContract.Requires(executionContext != null); InstanceId = instanceId; Runtime = runtime; ExecutionContext = executionContext; ExecutionContext.SetWorkflowInstance(this); }