Example #1
0
 public IList <string> GetUserConnectionIds(string email)
 {
     using (HubDbContext dbc = new HubDbContext())
     {
         var dao = new HubUserDao(dbc);
         return(dao.GetUserConnectionIds(email));
     }
 }
Example #2
0
 public void DeleteUserConnection(string connectionId)
 {
     using (HubDbContext dbc = new HubDbContext())
     {
         var dao = new HubUserDao(dbc);
         dao.DeleteUserConnection(connectionId);
     }
 }
Example #3
0
        public IList <string> GetAccountUserConnectionIds(ChatMessage chatMessage)
        {
            string[] emails = null;

            using (UserDbContext dbc = new UserDbContext())
            {
                var dao = new UserDao(dbc);
                emails = dao.GetAccountUsersEmails(chatMessage);
            }

            using (HubDbContext dbc = new HubDbContext())
            {
                var emailsString = string.Join("','", emails);
                var dao          = new HubUserDao(dbc);
                return(dao.GetUserConnectionIds(emailsString));
            }
        }
Example #4
0
        public void AddUserConnection(UserConnection userConnection)
        {
            //TODO: the user is validated from Intune database.
            // up on not finding it we skip to add into the active connections.
            // Find a better way to do this.
            // Currently we don't have SignalR support for refusing connections

            using (UserDbContext dbc = new UserDbContext())
            {
                var dao = new UserDao(dbc, userConnection);
                if (!dao.IsUserExists())
                {
                    return;
                }
            }

            using (HubDbContext dbc = new HubDbContext())
            {
                var dao = new HubUserDao(dbc, userConnection);
                dao.AddUserConnection();
            }
        }