mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-07 16:06:15 +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)
|
if (value.Value.ValueKind == JsonValueKind.Object || value.Value.ValueKind == JsonValueKind.Array)
|
||||||
return default;
|
return default;
|
||||||
|
|
||||||
var ttype = typeof(T);
|
return value.Value.Deserialize<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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user