Ejemplo n.º 1
0
 public IList <string> GetUserConnectionIds(string email)
 {
     using (HubDbContext dbc = new HubDbContext())
     {
         var dao = new HubUserDao(dbc);
         return(dao.GetUserConnectionIds(email));
     }
 }
Ejemplo n.º 2
0
 public void DeleteUserConnection(string connectionId)
 {
     using (HubDbContext dbc = new HubDbContext())
     {
         var dao = new HubUserDao(dbc);
         dao.DeleteUserConnection(connectionId);
     }
 }
Ejemplo n.º 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));
            }
        }
Ejemplo n.º 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();
            }
        }