locked
How to send and receive a list of particular type through SignalR RRS feed

  • Question

  • User-535495436 posted

    Hello!

    I try to send from the server to the client and vice-versa a list of Parent class defined as follow:

    class Parent
    {
        int id;
        string name;
        List<Child> children;
    
        public Parent(int ID, string Name, List<Child> Children)
        {
            id = ID;
            name = Name;
            children = Children;
        }
    }
    
    class Child
    {
        int id;
        string name;
        List<string> values;
    
        public Child(int ID, string Name, List<string> Values)
        {
            id = ID;
            name = Name;
            values = Values;
        }
    }

    The final data I want to send is this:

    //data I want to transfer between the client and the server and vice-versa

    List<Parent> mDialogData;

    I use the data in this list to populate a Windows Form dialog which is the client. I need the server to send the data to the client, after that to refresh the client dialog. After receving the data i need to modify some parameters in the client dialog and send back the list to the server to update some background processes based on the new data received from the client.  I do not understand how to send the list back and forth. I'm very new to SignalR and couldn't find a simple solution to understand how to achieve this goal.

    Thank you!

    Friday, January 10, 2020 4:05 PM

All replies