Suppress proxy generation for some hubs or methods

后端 未结 3 424
渐次进展
渐次进展 2021-01-03 07:21

I\'m starting out with SignalR and I have a situation where I\'m going to have a SignalR site that will be broadcasting messages to clients, but I also need an admin interfa

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-03 07:48

    We don't have a way of excluding specific methods from the proxy today. You'd have to re-implement your own proxy generator that basically does what we do in our default impl but has knowledge of some attribute to skip generation of specific methods.

    We can conceivable add this in a future version of SignalR. File an issue on github if you feel strongly about having this.

    Here's the default implementation (it would have been easier if we made more methods virtual and non static).

    https://github.com/SignalR/SignalR/blob/master/src/Microsoft.AspNet.SignalR.Core/Hubs/DefaultJavaScriptProxyGenerator.cs

提交回复
热议问题