Skip to content

EXTENSION: ObjVerEx.GetExactVersionLookup() extension method #85

@avonwyss

Description

@avonwyss

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions