Exemplo n.º 1
0
        public ICommandResult Handle(UpdateSubtitleCommand command)
        {
            //Fail Fast Validation
            command.Validate();
            if (command.Invalid)
            {
                return(new GenericCommandResult(false, Messages.Ex_ExceptionGeneric, command.Notifications));
            }

            var subtitle = _repository.GetById(command.Id);

            subtitle.UpdateSubtitle(command.Title);

            _repository.Update(subtitle);

            return(new GenericCommandResult(true, Messages.Act_Update, subtitle));
        }
Exemplo n.º 2
0
 public GenericCommandResult Update([FromBody] UpdateSubtitleCommand command, [FromServices] SubtitleHandler handler)
 {
     return((GenericCommandResult)handler.Handle(command));
 }