InstanceStore.TryCommand 方法

定义

永久性提供程序可实现此方法,这可确定是否可执行特定的永久性命令和是否可异步执行此命令。

protected public:
 virtual bool TryCommand(System::Runtime::DurableInstancing::InstancePersistenceContext ^ context, System::Runtime::DurableInstancing::InstancePersistenceCommand ^ command, TimeSpan timeout);
protected internal virtual bool TryCommand (System.Runtime.DurableInstancing.InstancePersistenceContext context, System.Runtime.DurableInstancing.InstancePersistenceCommand command, TimeSpan timeout);
abstract member TryCommand : System.Runtime.DurableInstancing.InstancePersistenceContext * System.Runtime.DurableInstancing.InstancePersistenceCommand * TimeSpan -> bool
override this.TryCommand : System.Runtime.DurableInstancing.InstancePersistenceContext * System.Runtime.DurableInstancing.InstancePersistenceCommand * TimeSpan -> bool
Protected Friend Overridable Function TryCommand (context As InstancePersistenceContext, command As InstancePersistenceCommand, timeout As TimeSpan) As Boolean

参数

context
InstancePersistenceContext

实例上下文。

command
InstancePersistenceCommand

要执行的命令。

timeout
TimeSpan

此操作的超时值。

返回

如果永久性提供程序实现不支持作为参数传递的命令,则它应返回 false;否则,它应返回 true 或引发一个异常。

注解

如果可执行此命令,永久性提供程序会对 InstancePersistenceContext 调用相关方法,以提供此命令的结果。

适用于