1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-17 19:33:07 +00:00

SocketConnection.Send check if object is string, if so it doesn't deserialize again

This commit is contained in:
JKorf
2020-01-29 17:05:28 +01:00
parent 649860b4d8
commit 82ff1aebaf
3 changed files with 5 additions and 144 deletions
@@ -216,7 +216,10 @@ namespace CryptoExchange.Net.Sockets
/// <param name="nullValueHandling">How null values should be serialized</param>
public virtual void Send<T>(T obj, NullValueHandling nullValueHandling = NullValueHandling.Ignore)
{
Send(JsonConvert.SerializeObject(obj, Formatting.None, new JsonSerializerSettings { NullValueHandling = nullValueHandling }));
if(obj is string str)
Send(str);
else
Send(JsonConvert.SerializeObject(obj, Formatting.None, new JsonSerializerSettings { NullValueHandling = nullValueHandling }));
}
/// <summary>