示例#1
0
        public Task Handle(SearchCommand notification, CancellationToken cancellationToken)
        {
            var msg = string.Join("\n", _repository.All().Select(t => t.ToString()));

            _messenger.SendMessage(notification.Id, msg);
            return(Task.CompletedTask);
        }
示例#2
0
        public Task Handle(DeleteCommand notification, CancellationToken cancellationToken)
        {
            var cmd = _repository.Find(notification.Id);

            if (cmd != null)
            {
                _repository.RemoveCommand(notification.Id);
                _messenger.SendMessage(notification.Id, "The command deleted");
            }

            return(Task.CompletedTask);
        }
示例#3
0
 public Task Handle(TimingCreatedNotification notification, CancellationToken cancellationToken)
 {
     _alertCommandRepository.AddCommand(notification.AlertCommand);
     _messenger.SendMessage(notification.Id, "Your Commanded Has Been Handled");
     return(Task.CompletedTask);
 }