I'm doing message forwarding with SignalR. I want to read my multiple Hub classes from config file as my project will be huge. Below is an example MapHub operation, but I want to read the class name from the config.
public static void Configure(IApplicationBuilder app)
{
IConfiguration config = app.ApplicationServices.GetService<IConfiguration>();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapHub<MyHub>("/myHub");// standart
endpoints.MapHub<"will be read from config file" > (config.GetSection("Hubs").GetValue(typeof(string), "MyHub").ToString());
});
}
Is there any way to do this? I would be glad if you help.