Click or drag to resize

IHistoryGetCurrentVersion Method

IT Hit WebDAV Classes Reference
Retrieves current item version.

Namespace: ITHit.WebDAV.Server.DeltaV
Assembly: ITHit.WebDAV.Server (in ITHit.WebDAV.Server.dll) Version: 4.5.3121.0
Syntax
IVersion GetCurrentVersion()

Return Value

Type: IVersion
.
Exceptions
ExceptionCondition
NeedPrivilegesExceptionThe user doesn't have enough privileges.
DavExceptionIn other cases.
Examples

The code below is part of 'WebDAVServer.DeltaV' sample provided with the SDK.

public IVersion GetCurrentVersion()
{
    string command = 
        @"SELECT VersionId, ItemId, VersionNumber, Name, Created, SerialNumber
          FROM Version
          WHERE ItemId = @ItemId AND VersionNumber = 
               (SELECT MAX(VersionNumber) FROM Version WHERE ItemId = @ItemId)";

    return context.ExecuteVersion(
        path.Remove(path.IndexOf('?')),
        command,
        "@ItemId", itemId).FirstOrDefault();
}
See Also