与 Signalr 进行群聊。如何发送给特定用户?

Group Chat with Signalr. How to send to specific users?

这些是我在数据库中添加的 table。

Database table 1

Database table 2

    //Group Chat Hub
    public void GroupChatSend(string name, string message)
    {
        //AddMessageinCacheWallChat(name, message);
        Clients.All.addNewMessageToGroupPage(name, message);
    }

和 // JavaScript

var GroupChat = function () {
    // Reference the auto-generated proxy for the hub.  
    var chat = $.connection.chatHub;

    // Create a function that the hub can call back to display messages.
    chat.client.addNewMessageToGroupPage = function (name, message) {
        // Add the message to the page. 
        $('#discussionGroupChat').append('<li><strong>' + htmlEncode(name)
            + '</strong>: ' + htmlEncode(message) + '</li>');
    };
    // Set initial focus to message input box.  
    $('#messageGroupChat').focus();
    // Start the connection.
    $.connection.hub.start().done(function () {
        var name = $('#userName').val();
        chat.server.connectWallChat(name);
        $('#sendmessageGroupChat').click(function () {
            // Call the Send method on the hub. 
            chat.server.groupChatSend(name, $('#messageGroupChat').val());
            // Clear text box and reset focus for next comment. 
            $('#messageGroupChat').val('').focus();
        });
    });
    // This optional function html-encodes messages for display in the page.
    function htmlEncode(value) {
        var encodedValue = $('<div />').text(value).html();
        return encodedValue;

    }

}

如何只向群组发送消息。还有成员 table 以及 id、用户名等。我没有使用 owin

Clients.Group(groupName).[应该在这个组上调用的方法](name, message);

http://www.asp.net/signalr/overview/guide-to-the-api/working-with-groups