SignalR mysql connection string .NET Core

40 views Asked by At

I'm trying to use SignalR with MySQL in .NET Core. I need to pass a dynamic connection string for SignalR.

I see services.AddSignalR().AddSqlServer() for SQL Server but I'm not able to see a similar one for MySql.

Can anyone please help?

Thanks

1

There are 1 answers

0
Md Farid Uddin Kiron On

I see services.AddSignalR().AddSqlServer() for SQL Server but I'm not able to see a similar one for MySql.

I am not sure in which way you are try to pass the dynamic connection string. While I was investigating your issue, I found that there's no overloading for AddSignalR() in order to pass the Database instance or connection string, at least the way, you are trying which is services.AddSignalR().AddSqlServer() I am not sure, where have you seen this.

There's no such official document I founded.

If you look at the SignalRDependencyInjectionExtensions interface you would seen, there's no method which we could use in order to pass .AddMySql(options => or even the sql server connection string.

enter image description here

enter image description here

enter image description here

Therefore, according to your shared code snippet, or query, we cannot pass the connection string through AddSignalR().

In addition, you could try within your HubClass. And it would be nicer if you could share more details about your hub class.

Note: Please refer to this official document, this might be resourceful for you.