Beispiel #1
0
        public void Handler(DeleteWhisperCommand command)
        {
            _whisperRepository.DeleteById(command.Id);
            DeleteWhisperEvent @event = new DeleteWhisperEvent();

            _eventBus.RaiseEventAsync(@event);
        }
Beispiel #2
0
        public void Handler(DeleteWhisperEvent eventData)
        {
            _cacheClient.Remove(ConstantKey.CACHE_SQUARE_WHISPER);
            IList <Whisper> whispers = _whisperRepository.SelectByPage(1, 12).ToList();

            foreach (var item in whispers)
            {
                _cacheClient.AddListTail(ConstantKey.CACHE_SQUARE_WHISPER, item);
            }
            whispers = whispers.Take(6).ToList();
            Message message = new Message();

            //首页微语
            message.Data = whispers;
            _singalrContent.SendAllClientsMessage(message);
        }