File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,6 @@ public readonly partial struct CallContext
12
12
#pragma warning restore CA2231 // Overload operator equals on overriding value type Equals
13
13
#pragma warning restore IDE0079 // Remove unnecessary suppression
14
14
{
15
- /// <inheritdoc/>
16
- public override bool Equals ( object ? obj ) => throw new NotSupportedException ( ) ;
17
- /// <inheritdoc/>
18
- public override int GetHashCode ( ) => throw new NotSupportedException ( ) ;
19
- /// <inheritdoc/>
20
- public override string ToString ( ) => nameof ( CallContext ) ;
21
15
22
16
/// <summary>
23
17
/// Performs a full-duplex operation that will await both the producer and consumer streams
Original file line number Diff line number Diff line change @@ -19,6 +19,21 @@ public readonly partial struct CallContext
19
19
#pragma warning restore CA2231 // Overload operator equals on overriding value type Equals
20
20
#pragma warning restore IDE0079 // Remove unnecessary suppression
21
21
{
22
+ /// <summary>Evaluates equality between <see cref="CallContext"/> values as defined by their <see cref="CallOptions"/>.</summary>
23
+ public override bool Equals ( object ? obj )
24
+ => obj switch
25
+ {
26
+ CallContext cc => this . CallOptions . Equals ( cc . CallOptions ) ,
27
+ CallOptions co => this . CallOptions . Equals ( co ) ,
28
+ _ => false ,
29
+ } ;
30
+
31
+ /// <summary>Evaluates a hashcodeas defined by the <see cref="CallOptions"/> of the instance.</summary>
32
+ public override int GetHashCode ( ) => this . CallOptions . GetHashCode ( ) ;
33
+
34
+ /// <inheritdoc/>
35
+ public override string ToString ( ) => nameof ( CallContext ) ;
36
+
22
37
/// <summary>
23
38
/// Default context; all default client options; no server context
24
39
/// </summary>
You can’t perform that action at this time.
0 commit comments