protected virtual void RaiseCanExecuteEvents()
 {
     MessageCommand.RaiseCanExecuteChanged();
     DeleteCommand.RaiseCanExecuteChanged();
     ReadCommand.RaiseCanExecuteChanged();
     ChangeCategoryCommand.RaiseCanExecuteChanged();
     FollowUpCommand.RaiseCanExecuteChanged();
 }
Beispiel #2
0
        public IEnumerable <Event> Handle(ChangeCategoryCommand message)
        {
            var category = _categories.GetCategory(message.Url);

            if (category == null)
            {
                throw new CategoryDoesNotExistException($"The category '{message.Url}' you are trying to update does not exist.");
            }

            yield return(new CategoryChangedEvent(message.AggregateId, message.Url, message.Title));
        }
        public async Task <IActionResult> ChangeCategory([FromQuery] ChangeCategoryCommand command)
        {
            await _mediator.Send(command);

            return(Ok());
        }
        public async Task <IActionResult> ChangeAsync([FromBody] ChangeCategoryCommand category, CancellationToken cancellationToken)
        {
            await _categoryApplication.ChangeAsync(category, cancellationToken);

            return(Ok());
        }
Beispiel #5
0
 public async Task ChangeAsync(ChangeCategoryCommand category, CancellationToken cancellationToken)
 {
     await _categoryRepository.ChangeAsync(category, cancellationToken);
 }