//--- Class Methods --- public static bool IsTierVersionCompatibleWithToolVersion(VersionInfo tierVersion, VersionInfo toolVersion) => toolVersion.IsPreRelease() // allow a tool pre-release, next version to be compatible with any previously deployed tier version ? tierVersion.GetMajorOnlyVersion().WithoutSuffix().IsEqualToVersion(toolVersion.GetMajorOnlyVersion().WithoutSuffix()) && tierVersion.IsLessOrEqualThanVersion(toolVersion) // tool major version must match tier major version : tierVersion.GetMajorOnlyVersion().IsEqualToVersion(toolVersion.GetMajorOnlyVersion());
public static int?CompareTierVersionToToolVersion(VersionInfo tierVersion, VersionInfo toolVersion) => (tierVersion.IsPreRelease() || toolVersion.IsPreRelease()) // for pre-releases, we need the entire version information to determine ordering of versions ? tierVersion.CompareToVersion(toolVersion) // for stable releases, we only need the major version : tierVersion.GetMajorOnlyVersion().CompareToVersion(toolVersion.GetMajorOnlyVersion());
public static VersionInfo GetCoreServicesReferenceVersion(VersionInfo version) => version.GetMajorOnlyVersion();
public static bool IsModuleCoreVersionCompatibleWithTierVersion(VersionInfo moduleCoreVersion, VersionInfo tierVersion) => moduleCoreVersion.GetMajorOnlyVersion().IsEqualToVersion(tierVersion.GetMajorOnlyVersion());
public static bool IsModuleCoreVersionCompatibleWithToolVersion(VersionInfo moduleCoreVersion, VersionInfo toolVersion) => toolVersion.IsPreRelease() ? moduleCoreVersion.GetMajorOnlyVersion().WithoutSuffix().IsEqualToVersion(toolVersion.GetMajorOnlyVersion().WithoutSuffix()) && moduleCoreVersion.IsLessOrEqualThanVersion(toolVersion) : moduleCoreVersion.GetMajorOnlyVersion().IsEqualToVersion(toolVersion.GetMajorOnlyVersion());