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)); }
public GenericCommandResult Update([FromBody] UpdateSubtitleCommand command, [FromServices] SubtitleHandler handler) { return((GenericCommandResult)handler.Handle(command)); }