mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-07 07:56:12 +00:00
Improved SystemTextJson message accessor value retrieval
This commit is contained in:
parent
b90a0a71e9
commit
3cdcf0d9be
@ -118,17 +118,7 @@ namespace CryptoExchange.Net.Converters.SystemTextJson
|
||||
if (value.Value.ValueKind == JsonValueKind.Object || value.Value.ValueKind == JsonValueKind.Array)
|
||||
return default;
|
||||
|
||||
var ttype = typeof(T);
|
||||
if (ttype == typeof(string))
|
||||
return (T?)(object?)value.Value.GetString();
|
||||
if (ttype == typeof(short))
|
||||
return (T)(object)value.Value.GetInt16();
|
||||
if (ttype == typeof(int))
|
||||
return (T)(object)value.Value.GetInt32();
|
||||
if (ttype == typeof(long))
|
||||
return (T)(object)value.Value.GetInt64();
|
||||
|
||||
return default;
|
||||
return value.Value.Deserialize<T>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
Loading…
x
Reference in New Issue
Block a user