private void SendMessage(Guid sysAdminUnitId, NotificationInfoResponse messageBody)
        {
            IMsgChannel channel = GetSysAdminUnitChannel(sysAdminUnitId);

            if (channel == null)
            {
                return;
            }
            IMsg message = GetChannelMessage(sysAdminUnitId, messageBody);

            channel.PostMessage(message);
        }
        private IMsg GetChannelMessage(Guid sysAdminUnit, NotificationInfoResponse messageBody)
        {
            var message = new SimpleMessage {
                Id     = sysAdminUnit,
                Body   = messageBody,
                Header =
                {
                    Sender       = SENDER,
                    BodyTypeName = BodyTypeName
                }
            };

            return(message);
        }
        private NotificationInfoResponse GetNotificationInfoResponse(IEnumerable <INotificationInfo> notifications)
        {
            var counters = notifications.Where(n => n.GroupName.IsNotEmpty())
                           .GroupBy(n => n.GroupName)
                           .Select(group => new {
                group.Key,
                Count = group.Count()
            }).ToDictionary(x => x.Key, x => x.Count);

            var notificationInfoResponse = new NotificationInfoResponse {
                Counters      = counters,
                Notifications = notifications
            };

            if (_userConnection.GetIsFeatureEnabled("UseDateForNotificationsQuery"))
            {
                notificationInfoResponse.LastRemindTime = GetLastRemindTime();
            }
            return(notificationInfoResponse);
        }