ASP.Net Core SignalR hub method overloading

Viewed 275

I have seen this question, which I presume is before .net core.

I want to do the same thing in a .net 5 project. My hub is like this:

public class TestHub : Hub
{
    public async Task TestMethod() => throw new NotImplementedException();
    public async Task TestMethod(string input) => throw new NotImplementedException();
}

and in Startup.cs when I try MapHub I get error

app.UseEndpoints(endpoints =>
{
    endpoints.MapHub<TestHub>("test");
});

System.NotSupportedException: 'Duplicate definitions of 'TestMethod'. Overloading is not supported.'

Is there a breaking change? In which versions of SignalR overloading was supported? How can I get around this porblem?

PS. The original case is that I have an existing hub that I want to change some method signatures without breaking change.

0 Answers
Related