@@ -86,12 +86,17 @@ public string ParametersAsJsonString
8686 {
8787 get
8888 {
89- if ( this . Parameters == null || this . Parameters . Count <= 0 )
89+ string parametersString ;
90+ if ( this . Parameters != null && this . Parameters . Count > 0 )
9091 {
91- return "{}" ;
92+ parametersString = JsonSerializer . Serialize ( this . Parameters , s_jsonSerializerOptions ) ;
93+ }
94+ else
95+ {
96+ parametersString = "{}" ;
9297 }
9398
94- return JsonSerializer . Serialize ( this . Parameters , s_jsonSerializerOptions ) ;
99+ return parametersString ;
95100 }
96101 }
97102
@@ -113,7 +118,7 @@ public override string ToString()
113118 /// <exception cref="ArgumentNullException">If <paramref name="value"/> is <see langword="null"/>.</exception>
114119 private static Dictionary < string , object ? > ? ConvertParametersFromJson ( string value )
115120 {
116- Dictionary < string , object ? > ? parameters = JsonSerializer . Deserialize < Dictionary < string , object ? > > ( value , CommandJsonSerializerContext . Default . DictionaryStringObject ! ) ;
121+ Dictionary < string , object ? > ? parameters = JsonSerializer . Deserialize < Dictionary < string , object ? > > ( value , s_jsonSerializerOptions ) ;
117122 return parameters ;
118123 }
119124 }
@@ -162,6 +167,5 @@ public override string ToString()
162167 [ JsonSerializable ( typeof ( Dictionary < string , short > ) ) ]
163168 [ JsonSerializable ( typeof ( Dictionary < string , ushort > ) ) ]
164169 [ JsonSerializable ( typeof ( Dictionary < string , string > ) ) ]
165- [ JsonSourceGenerationOptions ( Converters = [ typeof ( ResponseValueJsonConverter ) ] ) ]
166170 internal partial class CommandJsonSerializerContext : JsonSerializerContext ;
167171}
0 commit comments