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 以提供指令結果。