adTempus API
ArcanaDevelopment.adTempus.Client Namespace / DataContext Class / ViewObjectFromSnapshot Method


In This Topic
    ViewObjectFromSnapshot Method
    In This Topic
    Retrieves an object from a snapshot.
    Syntax
    'Declaration
     
    
    <CanBeNullAttribute()>
    Public Function ViewObjectFromSnapshot( _
       ByVal objectToView As OID, _
       ByVal snapshotID As Guid, _
       ByRef messages As MessageCollection _
    ) As ADTObject
    [CanBeNull()]
    public ADTObject ViewObjectFromSnapshot( 
       OID objectToView,
       Guid snapshotID,
       out MessageCollection messages
    )
    [CanBeNull()]
    public:
    ADTObject^ ViewObjectFromSnapshot( 
       OID^ objectToView,
       Guid snapshotID,
       [Out] MessageCollection^ messages
    ) 

    Parameters

    objectToView
    snapshotID
    messages

    Return Value

    A copy of the requested object from the snapshot, or a null reference (Nothing in Visual Basic) if the snapshot does not contain the object
    Exceptions
    ExceptionDescription
    Thrown if the DataContext has previously been used to fetch other objects. See Remarks.
    Remarks

    Important: This method can only be called on a new DataContext that has not previously been used to retrieve any objects (use NewDataContext to create a new DataContext. This is necessary to ensure that the copy of the object that is returned (and all contained and referenced objects) reflect the state they were in at the time of the snapshot. If the DataContext has previously been used, it is possible that the versions of those objects cached on the client might be returned to you instead of the version from the snapshot.

    If you call this method on a DataContext that has already been used you will get an InvalidOperationException.

    Snapshots are copies of objects created as a backup or to make it possible to revert changes to an object. They can be queried using Scheduler.QueryChangeLog to return ObjectChangeLog records.

    Once you have an ObjectChangeLog record representing a snapshot, ViewObjectFromSnapshot is used to retrieve an object from that snapshot.

    See Also