PersistenceProvider.EndLoadIfChanged(IAsyncResult, Object) 方法

定义

在派生类中实现时,表示“LoadIfChanged”阶段结束。When implemented in a derived class, represents the end of the LoadIfChanged phase. 将状态数据从持久性存储区加载到永久性提供程序中,并且持久性存储区中的状态数据已更改时,将进入“LoadIfChanged”阶段。The LoadIfChanged phase occurs when state data is loaded into the persistence provider from the persistence store, and the state data in the persistence store has been changed.

public:
 virtual bool EndLoadIfChanged(IAsyncResult ^ result, [Runtime::InteropServices::Out] System::Object ^ % instance);
public virtual bool EndLoadIfChanged (IAsyncResult result, out object instance);
abstract member EndLoadIfChanged : IAsyncResult * obj -> bool
override this.EndLoadIfChanged : IAsyncResult * obj -> bool
Public Overridable Function EndLoadIfChanged (result As IAsyncResult, ByRef instance As Object) As Boolean

参数

result
IAsyncResult

对操作结果的引用。A reference to the result of the operation.

instance
Object

实际的实例状态。The actual instance state.

返回

Boolean

如果使用持久性存储区中的最新副本设置实例 true 参数,则为 out;如果本地缓存状态已经是最新的,则为 falsetrue if the instance out parameter has been set with the latest copy from the persistence store; false if the locally cached state is already up-to-date.

示例

下面的代码演示如何实现 EndLoadIfChanged 方法。The following code demonstrates how to implement the EndLoadIfChanged method.

public override bool EndLoadIfChanged(IAsyncResult result, out object instance)
{
    base.ThrowIfDisposedOrNotOpen();
    instance = this.factory.EndLoad(result);
    return true;
}

适用于