There are methods for adding lookups with a specific version, e.g. AddLookup(propId, objVer, exactVersion) on both PropertyValues and ObjVerEx. However, when one needs to get a Lookup to an exact version, there is currently no helper available for doing so from an ObjVerEx.
The ToLookup(latestVersion) extension method will only set the lookup to the latest version (-1) when true is passed in, it will however not do the contrary when passing false and thus the returned Lookup remains latest-version if it was like this before.
Since changing this behavior would be a severely breaking change, it would make sense to keep this as-is and add an extension method GetExactVersionLookup which returns the exact version lookup, e.g. does this:
return new Lookup() {
ObjectType = objVerEx.Type,
Item = objVerEx.ID,
Version = objVerEx.Version
}
There are methods for adding lookups with a specific version, e.g.
AddLookup(propId, objVer, exactVersion)on bothPropertyValuesandObjVerEx. However, when one needs to get aLookupto an exact version, there is currently no helper available for doing so from anObjVerEx.The
ToLookup(latestVersion)extension method will only set the lookup to the latest version (-1) whentrueis passed in, it will however not do the contrary when passingfalseand thus the returnedLookupremains latest-version if it was like this before.Since changing this behavior would be a severely breaking change, it would make sense to keep this as-is and add an extension method
GetExactVersionLookupwhich returns the exact version lookup, e.g. does this: