예제 #1
0
        public void SendNotification(string fromUserId, string toUserId, string notificationType)
        {
            int notificationId = _userServiceAgent.SaveUserNotification(notificationType, fromUserId, toUserId);
            var connectionId   = _userServiceAgent.GetUserConnectionId(toUserId);

            if (connectionId != null && connectionId.Count() > 0)
            {
                var userInfo           = _defaultHelper.GetUserModel(fromUserId);
                int notificationCounts = _userServiceAgent.GetUserNotificationCounts(toUserId);
                Clients.Clients(connectionId).ReceiveNotification(notificationType, userInfo, notificationId, notificationCounts);
            }
        }