PersistenceProvider.BeginUpdate(Object, TimeSpan, AsyncCallback, Object) 方法
定义
在派生类中实现时,表示“更新”阶段开始。When implemented in a derived class, represents the beginning of the Update phase. 在持久性存储区中更新服务状态数据时将进入“更新”阶段。The Update phase occurs when service state data is updated in the persistence store.
public:
abstract IAsyncResult ^ BeginUpdate(System::Object ^ instance, TimeSpan timeout, AsyncCallback ^ callback, System::Object ^ state);
public abstract IAsyncResult BeginUpdate (object instance, TimeSpan timeout, AsyncCallback callback, object state);
abstract member BeginUpdate : obj * TimeSpan * AsyncCallback * obj -> IAsyncResult
Public MustOverride Function BeginUpdate (instance As Object, timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult
参数
- instance
- Object
实际的实例状态。The actual instance state.
- timeout
- TimeSpan
时间段,永久性提供程序在该时间段后将中止此尝试。The time period after which the persistence provider aborts this attempt.
- callback
- AsyncCallback
操作完成时将要调用的方法。The method to be called when the operation is completed.
- state
- Object
一个用户提供的对象,该对象用于将此特定异步操作与其他操作区别开来。A user-provided object that distinguishes this particular asynchronous operation from other operations.
返回
BeginUpdate(Object, TimeSpan, AsyncCallback, Object) 异步方法调用的状态。The state of the BeginUpdate(Object, TimeSpan, AsyncCallback, Object) asynchronous method call.
示例
下面的代码演示如何实现 BeginUpdate 方法。The following code demonstrates how to implement the BeginUpdate method.
public override IAsyncResult BeginUpdate(object instance, TimeSpan timeout, AsyncCallback callback, object state)
{
base.ThrowIfDisposedOrNotOpen();
return this.factory.BeginUpdate(this.Id, instance, timeout, callback, state);
}