Example #1
0
        public ICommandResult Handle(UpdateRoadMapCommand command)
        {
            //Fail Fast Validation
            command.Validate();
            if (command.Invalid)
            {
                return(new GenericCommandResult(false, Messages.Ex_ExceptionGeneric, command.Notifications));
            }

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

            roadMap.UpdateRoadMap(command.Title);

            _repository.Update(roadMap);

            return(new GenericCommandResult(true, Messages.Act_Update, roadMap));
        }
Example #2
0
 public GenericCommandResult Update([FromBody] UpdateRoadMapCommand command, [FromServices] RoadMapHandler handler)
 {
     return((GenericCommandResult)handler.Handle(command));
 }