Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 3f2a404

Browse files
nosamimonojenkins
authored andcommitted
Implement IComparable<SupportPolicyVersion>
1 parent c6934bf commit 3f2a404

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/Configuration/SupportPolicyVersion.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.WebTools.Scaffolding.Core
1212
/// NetStandard21 => The package versions should be 2.1.x
1313
/// Net22 => The package versions should be 2.2.x
1414
/// </summary>
15-
class SupportPolicyVersion : IComparable
15+
class SupportPolicyVersion : IComparable, IComparable<SupportPolicyVersion>
1616
{
1717
public static readonly SupportPolicyVersion LTS10 = new SupportPolicyVersion (new Version ("1.0.0"));
1818
public static readonly SupportPolicyVersion FTS11 = new SupportPolicyVersion (new Version ("1.1.0"));
@@ -89,6 +89,11 @@ public override int GetHashCode ()
8989
return Version.GetHashCode ();
9090
}
9191

92+
public int CompareTo (SupportPolicyVersion other)
93+
{
94+
return other.Version.CompareTo (Version);
95+
}
96+
9297
public static bool operator == (SupportPolicyVersion s1, SupportPolicyVersion s2)
9398
{
9499
if (ReferenceEquals (s1, s2)) {

0 commit comments

Comments
 (0)