99namespace GitHub . Models
1010{
1111 [ DebuggerDisplay ( "{DebuggerDisplay,nq}" ) ]
12- public sealed class PullRequestModel : NotificationAwareObject , IPullRequestModel
12+ public sealed class PullRequestModel : NotificationAwareObject , IPullRequestModel ,
13+ IEquatable < PullRequestModel > ,
14+ IComparable < PullRequestModel >
1315 {
1416 public PullRequestModel ( int number , string title ,
1517 IAccount author , [ AllowNull ] IAccount assignee ,
@@ -45,7 +47,7 @@ public override bool Equals([AllowNull]object obj)
4547
4648 public override int GetHashCode ( )
4749 {
48- return Number ;
50+ return Number . GetHashCode ( ) ;
4951 }
5052
5153 bool IEquatable < IPullRequestModel > . Equals ( [ AllowNull ] IPullRequestModel other )
@@ -55,11 +57,23 @@ bool IEquatable<IPullRequestModel>.Equals([AllowNull]IPullRequestModel other)
5557 return other != null && Number == other . Number ;
5658 }
5759
60+ bool IEquatable < PullRequestModel > . Equals ( [ AllowNull ] PullRequestModel other )
61+ {
62+ if ( ReferenceEquals ( this , other ) )
63+ return true ;
64+ return other != null && Number == other . Number ;
65+ }
66+
5867 public int CompareTo ( [ AllowNull ] IPullRequestModel other )
5968 {
6069 return other != null ? UpdatedAt . CompareTo ( other . UpdatedAt ) : 1 ;
6170 }
6271
72+ public int CompareTo ( [ AllowNull ] PullRequestModel other )
73+ {
74+ return other != null ? UpdatedAt . CompareTo ( other . UpdatedAt ) : 1 ;
75+ }
76+
6377 public static bool operator > ( [ AllowNull ] PullRequestModel lhs , [ AllowNull ] PullRequestModel rhs )
6478 {
6579 if ( ReferenceEquals ( lhs , rhs ) )
@@ -76,7 +90,7 @@ public int CompareTo([AllowNull]IPullRequestModel other)
7690
7791 public static bool operator == ( [ AllowNull ] PullRequestModel lhs , [ AllowNull ] PullRequestModel rhs )
7892 {
79- return Equals ( lhs , rhs ) && ( ( object ) lhs == null || lhs . CompareTo ( rhs ) == 0 ) ;
93+ return ReferenceEquals ( lhs , rhs ) ;
8094 }
8195
8296 public static bool operator != ( [ AllowNull ] PullRequestModel lhs , [ AllowNull ] PullRequestModel rhs )
0 commit comments