1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2026-04-08 02:31:11 +00:00
This commit is contained in:
Jkorf 2026-04-07 16:35:43 +02:00
parent 7c34b62866
commit 0d3ccf25a7
5 changed files with 8 additions and 12 deletions

View File

@ -335,7 +335,9 @@ namespace CryptoExchange.Net.Converters.SystemTextJson
var mappingStringToEnum = new List<EnumMapping>();
var mappingEnumToString = new Dictionary<T, string>();
#pragma warning disable IL2080
var enumMembers = _enumType.GetFields();
#pragma warning restore IL2080
foreach (var member in enumMembers)
{
var maps = member.GetCustomAttributes(typeof(MapAttribute), false);

View File

@ -25,7 +25,8 @@ namespace CryptoExchange.Net.Sockets.Default.Routing
if (!_routeTableEntries.ContainsKey(route.TypeIdentifier))
_routeTableEntries.Add(route.TypeIdentifier, new RoutingTableEntry(route.DeserializationType));
_routeTableEntries[route.TypeIdentifier].Handlers.Add(entry);
if (!_routeTableEntries[route.TypeIdentifier].Handlers.Contains(entry))
_routeTableEntries[route.TypeIdentifier].Handlers.Add(entry);
}
}
}

View File

@ -9,11 +9,8 @@ using CryptoExchange.Net.Sockets.Default.Routing;
using CryptoExchange.Net.Sockets.Interfaces;
using Microsoft.Extensions.Logging;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Net.WebSockets;
using System.Text;
@ -1153,13 +1150,7 @@ namespace CryptoExchange.Net.Sockets.Default
{
var updatedList = new List<IMessageProcessor>(_listeners);
updatedList.Add(processor);
processor.OnMessageRouterUpdated += () =>
{
BuildRoutingTable();
#if DEBUG
_logger.LogTrace("MessageRouter updated, new routing table:\r\n" + _routeTable.ToString());
#endif
};
processor.OnMessageRouterUpdated += BuildRoutingTable;
_listeners = updatedList.AsReadOnly();
if (processor.MessageRouter.Routes.Length > 0)
{

View File

@ -22,7 +22,7 @@ namespace CryptoExchange.Net.Sockets.Interfaces
/// <summary>
/// Event when the message router for this processor has been changed
/// </summary>
public event Action OnMessageRouterUpdated;
public event Action? OnMessageRouterUpdated;
/// <summary>
/// Handle a message
/// </summary>

View File

@ -48,6 +48,7 @@ namespace CryptoExchange.Net.Testing
/// <param name="methodInvoke">Method invocation</param>
/// <param name="name">Method name for looking up json test values</param>
/// <param name="endpointOptions">Request options</param>
/// <param name="validation">Callback to validate the response model</param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public Task ValidateAsync<TResponse>(
@ -65,6 +66,7 @@ namespace CryptoExchange.Net.Testing
/// <param name="methodInvoke">Method invocation</param>
/// <param name="name">Method name for looking up json test values</param>
/// <param name="endpointOptions">Request options</param>
/// <param name="validation">Callback to validate the response model</param>
/// <returns></returns>
/// <exception cref="Exception"></exception>
public async Task ValidateAsync<TResponse, TActualResponse>(