InstanceStore.TryCommand 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
持久性提供程序实现此方法,该方法确定是否可以执行特定的持久性命令,以及是否可以异步执行该命令。
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 ,以提供命令的结果。