public void OnDisconnected(int companyId, int userId, string connectionId)
        {
            RealTimeNotificationConnection connection = realTimeNotificationRepository.SingleOrDefault(x => x.CompanyId == companyId && x.UserId == userId && x.ConnectionId == connectionId);

            if (connection != null)
            {
                connection.IsConnected = false;

                realTimeNotificationRepository.Update(connection);
            }
        }
        public void OnConnected(int companyId, int userId, string connectionId)
        {
            RealTimeNotificationModel realTimeNotificationModel = new RealTimeNotificationModel();

            realTimeNotificationModel.ConnectionId = connectionId;
            realTimeNotificationModel.IsConnected  = true;
            realTimeNotificationModel.UserId       = userId;
            realTimeNotificationModel.CompanyId    = companyId;
            RealTimeNotificationConnection realTimeNotificationConnection = new RealTimeNotificationConnection();

            AutoMapper.Mapper.Map(realTimeNotificationModel, realTimeNotificationConnection);
            realTimeNotificationRepository.Insert(realTimeNotificationConnection);
        }