[c# SignalR] Calling a hub method with optional arguments without providing it from the JS client?
In this case I'm invoking a hub method that returns a list of objects but sometimes I want more or less so I wrote the hub method that has an optional argument to do so. The issue is that I'm not sure how to invoke the hub method without using any arguments in my JS client calls as it doesn't seem to hit the hub method..
I could call the GetSomething method in the hub like this in the JS client -> proxy.invoke('GetSomething', 10); to get 10 objects, if I want to get 5 objects I could do either proxy.invoke('GetDonations', 5); OR proxy.invoke('GetDonations'); as the default argument is 5 but when invoking without any arguments instead of calling the method with the optional argument (ideally) it calls the overloaded method with no arguments that in turns calls the method with the optional argument, see why it's ugly?
Ideally the method without any arguments would be made redundant but by doing so the JS client can't invoke the method without passing any arguments so the additional method is required for the JS client function to work..
If anyone has a more elegant solution let me know.