Table of Contents

Method TryFrom

Namespace
Ubiquity.NET.Versioning
Assembly
Ubiquity.NET.Versioning.dll

TryFrom(SemVer, out CSemVer, out Exception)

Tries to parse a SemVer as a CSemVer

public static bool TryFrom(SemVer ver, out CSemVer result, out Exception reason)

Parameters

ver SemVer

Version to convert

result CSemVer

Result or default if not convertible

reason Exception

Reason that conversion is not allowed (or null if it is)

Returns

bool

true if the conversion is performed or false if not (reason will hold reason it is not successful)

Remarks

While EVERY CSemVer conforms to valid SemVer the reverse is not always true. This method attempts to make a conversion using the classic try pattern with the inclusion of an exception that explains the reason for any failures. This is useful in debugging or for creating wrappers that will throw the exception.