File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -100,20 +100,25 @@ protected virtual Renor GetRenor(JToken @object)
100
100
101
101
var properties = request . Properties ( ) . ToLookup ( z => z . Name , StringComparer . OrdinalIgnoreCase ) ;
102
102
103
+ var traceStateProperty = properties [ "tracestate" ] . FirstOrDefault ( ) ;
104
+ var traceState = traceStateProperty ? . Value . ToString ( ) ;
105
+ var traceParentProperty = properties [ "traceparent" ] . FirstOrDefault ( ) ;
106
+ var traceParent = traceParentProperty ? . Value . ToString ( ) ;
107
+
103
108
// id == request
104
109
// !id == notification
105
110
if ( ! hasRequestId )
106
111
{
107
112
return new Notification ( method ! , @params ) {
108
- TraceState = properties [ "tracestate" ] . FirstOrDefault ( ) ? . Value < string > ( ) ,
109
- TraceParent = properties [ "traceparent" ] . FirstOrDefault ( ) ? . Value < string > ( )
113
+ TraceState = traceState ,
114
+ TraceParent = traceParent ,
110
115
} ;
111
116
}
112
117
else
113
118
{
114
119
return new Request ( requestId ! , method ! , @params ) {
115
- TraceState = properties [ "tracestate" ] . FirstOrDefault ( ) ? . Value < string > ( ) ,
116
- TraceParent = properties [ "traceparent" ] . FirstOrDefault ( ) ? . Value < string > ( )
120
+ TraceState = traceState ,
121
+ TraceParent = traceParent ,
117
122
} ;
118
123
}
119
124
}
You can’t perform that action at this time.
0 commit comments