Exemplo n.º 1
0
        /// <summary>
        /// 批量将所有未处理通知修改为已处理状态
        /// </summary>
        /// <param name="userId">接收人Id</param>
        public void BatchSetIsHandled(long userId)
        {
            IEnumerable <Notice> notices = noticeRepository.GetTops(userId, int.MaxValue);

            EventBus <Notice> .Instance().OnBatchBefore(notices, new CommonEventArgs(EventOperationType.Instance().Update()));

            noticeRepository.BatchSetIsHandled(userId);
            EventBus <Notice> .Instance().OnBatchAfter(notices, new CommonEventArgs(EventOperationType.Instance().Update()));
        }