我从MVC Controller动作中调用SignalR
var context = GlobalHost.ConnectionManager.GetHubContext<MyHub>();
var ret = context.Clients.Client("Whatever").getValue(userId);
Run Code Online (Sandbox Code Playgroud)
无论如何我可以从动作中的客户端调用getValue()方法获得响应吗?
我尝试了几种方法,但根本无法获得任何ret值.我很确定这不适用于SignalR Hub但无法找到有关此内容的文档.
我考虑过的一个解决方案是在收到getValue之后客户端会在Hub中调用一个方法但是我不得不破解我从Hub获取响应到控制器的方法.
我被迫/付钱参与Legacy ColdFusion项目(我是一名普通的C#程序员),而CF的一个特点就是他们拥有自己的标签,应该与HTML混合(坏的决定,IMO)因为即使是"以cf规则开始",它也只会让我感到困惑.
除此之外,他们还有#字符表示CF"领域"的开头非常相似<ASP.Net中的%或Spark中的$或等价物.但是只有在标签内部才能解析.
我的问题是:在文件开头打开一个标签并关闭它是否有问题,反对仅在我要使用#字符时使用?
为了说明这里的一些代码:
<cfoutput>
Some text #SomeVar# Some text.<br />
Some Images some other things #AnotherVar#
</cfoutput>
Run Code Online (Sandbox Code Playgroud)
反对:
Some text <cfoutput>#SomeVar#</cfoutput> Some text.<br/>
Some Images some other things <cfoutput>#AnotherVar#</cfoutput>
Run Code Online (Sandbox Code Playgroud)
当然,这对于小内容来说可能看起来微不足道,但我在谈论一整页.