Hello,
I tried to create custom methods:
namespace Server.Modules
{
/// <summary>
/// Implement/Override your custom actionmethods, events etc in this real-time MVC controller
/// </summary>
[XSocketMetadata("controller")]
public class MyController : XSocketController
{
public override async Task OnMessage(IMessage message)
{
await this.InvokeToAll(message);
}
public async Task Foo()
{
//Send a message to all clients with the topic 'say'
await this.InvokeToAll("Foo: Hello to all", "foo");
}
public async Task Bar(string message)
{
//Send out the message that was sent in to all clients
await this.InvokeToAll(string.Format("Bar: {0}", message), "bar");
}
}
}
But when i tried to call it, it go to OnMessage, not Foo.