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