Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PersistenceProvider::LoadIfChanged Method (TimeSpan, Object^, Object^%)

 

When implemented in a derived class, loads service state information from the persistence store if that data has been changed.

Namespace:   System.ServiceModel.Persistence
Assembly:  System.WorkflowServices (in System.WorkflowServices.dll)

public:
virtual bool LoadIfChanged(
	TimeSpan timeout,
	Object^ instanceToken,
	[OutAttribute] Object^% instance
)

Parameters

timeout
Type: System::TimeSpan

The time period after which the persistence provider aborts this attempt.

instanceToken
Type: System::Object^

The token returned by a previous Create or Update, which represents the current state held by the caller.

instance
Type: System::Object^%

The actual instance state.

Return Value

Type: System::Boolean

true if the instanceout parameter has been set with the latest copy from the persistence store; false if the locally cached state is already up to date.

The following code demonstrates how to implement the LoadIfChanged method.

public override bool LoadIfChanged(TimeSpan timeout, object instanceToken, out object instance)
{
    base.ThrowIfDisposedOrNotOpen();
    instance = this.factory.Load(this.Id, timeout);
    return true;
}

.NET Framework
Available since 3.5
Return to top
Show:
© 2017 Microsoft