Esempio n. 1
0
        public void SendNotification(int fromUserID, int toUserID, string notificationType)
        {
            int notificationID = _UserRepo.SaveUserNotification(notificationType, fromUserID, toUserID);
            var connectionId   = _UserRepo.GetUserConnectionID(toUserID);

            if (connectionId != null && connectionId.Count() > 0)
            {
                var userInfo           = CommonFunctions.GetUserModel(fromUserID);
                int notificationCounts = _UserRepo.GetUserNotificationCounts(toUserID);
                Clients.Clients(connectionId).ReceiveNotification(notificationType, userInfo, notificationID, notificationCounts);
            }
        }