Looking at the question (text, not code), I understand that you are trying to send the Complex object to the JS side and use it there? It is right?
In this case, the solution should be simple:
From ASP.NET.SignalR :
You can specify the type and parameters of the return, including complex types and arrays, as in any C # method. Any data that you receive in the parameters or return to the caller is transferred between the client and server using JSON, and SignalR processes the binding of complex objects and arrays of objects automatically .
C # example:
public void SendMessage(string name, string message)
{
Clients.All.addContosoChatMessageToPage(new ContosoChatMessage() { UserName = name, Message = message });
}
JS:
var contosoChatHubProxy = $.connection.contosoChatHub;
contosoChatHubProxy.client.addMessageToPage = function (message) {
console.log(message.UserName + ' ' + message.Message);
});
ContosoChatMessage:
public class ContosoChatMessage
{
public string UserName { get; set; }
public string Message { get; set; }
}
( ...)
, , JS "" "model.XY", XY .
, .