how SignalR works in Web API
<p>I'm working in SignalR chat project   <a href="http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr-and-mvc" rel="nofollow">like this example</a></p>

<p>It works well however, I want to make chat hub.cs in a Web API project and call it from other client projects.</p>

<p>I have searched for solutions but haven't found any. How do I achieve this.</p>

<p>My <code>chatHub</code></p>

<pre><code>public class ChatHub : Hub
{
        dbcontext db = new dbcontext();
        ChatManager chatManager = new ChatManager();
    public static string ConnectionId = null;

    public void Send(string name, string message)
    {
        ConnectedUsers cu = chatManager.getCurrentUserRow(Context.ConnectionId);

        if (cu != null)
        {
            string L_ConnectionId = cu.Other_ConnectionId;

            Clients.Client(L_ConnectionId)
                .addNewMessageToPage(name, message);
        }
    }
    public override Task OnConnected()
    {
        Console.WriteLine("Connected user: " + Context.User.Identity.Name);
        ConnectionId = Context.ConnectionId;
        chatManager.AddAndRemoveUser(true, Context.ConnectionId); // to add user in connectedUser Table
        chatManager.OpenRandomChat(Context.ConnectionId);

        return base.OnConnected();
    }
    public override Task OnDisconnected(bool stopCalled)
    {
        chatManager.RemoveLeftUser(Context.ConnectionId);
        chatManager.AddAndRemoveUser(false, Context.ConnectionId);
        return base.OnDisconnected(stopCalled);
    }
    public override Task OnReconnected()
    {
        Console.WriteLine("ReConnected user: " + Context.User.Identity.Name);
        return base.OnReconnected();
    }
    public void NewConnection()
    {
        int retVal = -1;
        chatManager.RemoveLeftUser(Context.ConnectionId); // to remove left user from 2 users
        chatManager.OpenRandomChat(Context.ConnectionId); // to chosse random user for me 

        // to get me and my if i have partner ..
        ConnectedUsers cu = chatManager.getCurrentUserRow(Context.ConnectionId);

        if (cu != null)
        {
            retVal = 0;
            //string groupId = cu.ConnectionId + cu.Other_ConnectionId;
            //string R_ConnectionId = cu.ConnectionId;
            string L_ConnectionId = cu.Other_ConnectionId;
        }
        Clients.Client(Context.ConnectionId)
              .sendGroupData(retVal);
    }

    public void SendQuestion(string question)
    {
        ConnectedUsers cu = chatManager.getCurrentUserRow(Context.ConnectionId);
        if (cu != null)
        {
            string L_ConnectionId = cu.Other_ConnectionId;
            Clients.Client(L_ConnectionId)
                .sendQuestion(question);
        }
    }
    public void AnswerQuestion(string answer)
    {
        ConnectedUsers cu = chatManager.getCurrentUserRow(Context.ConnectionId);
        if (cu != null)
        {
            string L_ConnectionId = cu.Other_ConnectionId;

            Clients.Client(L_ConnectionId)
                .answerQuestion(answer);
        }
    }
}
</code></pre>