asp.net mvc - how to handle connections to hub across the project -
i have multiple roles in project , have make connections hubs across project ..
ex : in project , roles : receptionist, doctor
when receptionist adds appointment particular doctor, have notify , update appointments list of particular doctor in page(where doctor role)
is put entire server methods in 1 hub class , if not how make connection bt multiple hubs
can 1 suggest how handle issue ?
you can use same connection access multiple hubs.
.net client var hubconnection = new hubconnection(url); var hubproxy1 = hubconnection.createhubproxy("hub1"); var hubproxy2 = hubconnection.createhubproxy("hub2"); await hubconnection.start();
js client $.connection.myhub1.server.method1(); $.connection.myhub2.server.method2(); $.connection.hub.start();
Comments
Post a Comment