Chatjs:如何从sql数据库中获取好友列表

时间:2015-04-02 06:48:17

标签: asp.net signalr chatjs

我在使用信号器适配器的asp.net webapplication中使用ChatJs。如何在页面加载时从数据库中显示在线用户。由于我是asp.net的新手,请指导我。提前谢谢

/// <summary>
    /// This method is STUB. This will SIMULATE a database of users
    /// </summary>
    private static readonly List<DbUserStub> dbUsersStub = new List<DbUserStub>();
// <summary>
    /// This method is STUB. In a normal situation, the user info would come from the database so this method wouldn't be necessary.
    /// It's only necessary because this class is simulating the database
    /// </summary>
    /// <param name="newUser"></param>
    public static void RegisterNewUser(DbUserStub newUser)
    {
        if (newUser == null) throw new ArgumentNullException("newUser");
        dbUsersStub.Add(newUser);
    }

0 个答案:

没有答案