コード例 #1
0
        public IAsyncResult BeginExecute(InstanceHandle handle, InstancePersistenceCommand command, TimeSpan timeout, AsyncCallback callback, object state)
        {
            if (command == null)
            {
                throw Fx.Exception.ArgumentNull("command");
            }
            if (handle == null)
            {
                throw Fx.Exception.ArgumentNull("handle");
            }
            if (!object.ReferenceEquals(this, handle.Store))
            {
                throw Fx.Exception.Argument("handle", SRCore.ContextNotFromThisStore);
            }
            TimeoutHelper.ThrowIfNegativeArgument(timeout);

            return(InstancePersistenceContext.BeginOuterExecute(handle, command, timeout, callback, state));
        }
コード例 #2
0
        public InstanceView Execute(InstanceHandle handle, InstancePersistenceCommand command, TimeSpan timeout)
        {
            if (command == null)
            {
                throw Fx.Exception.ArgumentNull("command");
            }
            if (handle == null)
            {
                throw Fx.Exception.ArgumentNull("handle");
            }
            if (!object.ReferenceEquals(this, handle.Store))
            {
                throw Fx.Exception.Argument("handle", SRCore.ContextNotFromThisStore);
            }
            TimeoutHelper.ThrowIfNegativeArgument(timeout);

            return(InstancePersistenceContext.OuterExecute(handle, command, timeout));
        }
コード例 #3
0
 protected internal virtual IAsyncResult BeginTryCommand(InstancePersistenceContext context, InstancePersistenceCommand command, TimeSpan timeout, AsyncCallback callback, object state)
 {
     return(new CompletedAsyncResult <bool>(false, callback, state));
 }
コード例 #4
0
 protected internal virtual bool TryCommand(InstancePersistenceContext context, InstancePersistenceCommand command, TimeSpan timeout)
 {
     return(EndTryCommand(BeginTryCommand(context, command, timeout, null, null)));
 }