public ServiceDurableInstance(
     PersistenceProvider persistenceProvider,
     ServiceDurableInstanceContextProvider contextManager,
     bool saveStateInOperationTransaction,
     UnknownExceptionAction unknownExceptionAction,
     DurableRuntimeValidator runtimeValidator,
     TimeSpan operationTimeout)
     : this(persistenceProvider, contextManager, saveStateInOperationTransaction, unknownExceptionAction, runtimeValidator, operationTimeout, null)
 {
 }
        public ServiceDurableInstance(
            PersistenceProvider persistenceProvider,
            ServiceDurableInstanceContextProvider contextManager,
            bool saveStateInOperationTransaction,
            UnknownExceptionAction unknownExceptionAction,
            DurableRuntimeValidator runtimeValidator,
            TimeSpan operationTimeout,
            Type serviceType)
            : base(contextManager, persistenceProvider == null ? Guid.Empty : persistenceProvider.Id)
        {
            if (persistenceProvider == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("persistenceProvider");
            }

            if (contextManager == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("contextManager");
            }

            if (runtimeValidator == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("runtimeValidator");
            }

            Fx.Assert(operationTimeout > TimeSpan.Zero,
                "Timeout needs to be greater than zero.");

            this.lockingProvider = persistenceProvider as LockingPersistenceProvider;
            this.provider = persistenceProvider;
            this.contextManager = contextManager;
            this.saveStateInOperationTransaction = saveStateInOperationTransaction;
            this.unknownExceptionAction = unknownExceptionAction;
            this.runtimeValidator = runtimeValidator;
            this.operationTimeout = operationTimeout;
            this.newServiceType = serviceType;
        }