public ActionResult updateCommand(int id, CommandUpdate cmdUpdate) { var cmdObj = _repoObj.getCommandById(id); if (cmdObj == null) { return(NotFound()); } _mapper.Map(cmdUpdate, cmdObj); _repoObj.updateCommand(cmdObj); _repoObj.saveChanges(); return(NoContent()); }
public static void OnUpdateCommand(ref YotogiPlay.PlayerState playerState, ref Dictionary <YotogiPlay.PlayerState, Yotogi.SkillData.Command.Data[]> commandDictionary, ref YotogiCommandFactory commandFactory) { CommandUpdateEventArgs args = new CommandUpdateEventArgs { CommandFactory = commandFactory, Commands = commandDictionary, PlayerState = playerState }; CommandUpdate?.Invoke(null, args); }
public async Task UpdateCommand(CommandUpdate command, int id) { var originalCommand = await GetCommandById(id); if (originalCommand == null) { return; } var updatedCommmand = Mapper.Map(command, originalCommand); await Repository.UpdateCommand(updatedCommmand); await Repository.SaveChangesAsync(); }
public ActionResult UpdateCommand(int id, CommandUpdate commandUpdateDto) { var commandModelFromRepo = _repository.GetCommandById(id); if (commandModelFromRepo == null) { return(NotFound()); } _mapper.Map(commandUpdateDto, commandModelFromRepo); _repository.UpdateCommand(commandModelFromRepo); _repository.SaveChanges(); return(NoContent()); }
void InitializeProperties() { SelectedTrim.Subscribe((v) => { SetTrimSettingsWith(v); }); Prologue.Subscribe((v) => { UpdateButtonStatus(); }); Epilogue.Subscribe((v) => { UpdateButtonStatus(); }); PrologueEnabled.Subscribe((v) => { UpdateButtonStatus(); }); EpilogueEnabled.Subscribe((v) => { UpdateButtonStatus(); }); TrimmingName.Subscribe((v) => { UpdateButtonStatus(); }); Started.Subscribe((V) => { UpdatePlayingState(); }); Pausing.Subscribe((v) => { UpdatePlayingState(); }); Duration.Subscribe((v) => { }); CommandRegister.Subscribe(ExecRegister); CommandApply.Subscribe(ExecApply); CommandUpdate.Subscribe(ExecUpdate); CommandUndo.Subscribe(ExecUndo); CommandCancel.Subscribe(ExecCancel); CommandSelect.Subscribe(ExecSelect); Rating.Subscribe(ChangeRating); }
public async Task <ActionResult> UpdateCommand(CommandUpdate command, int id) { await CommandsServices.UpdateCommand(command, id); return(NoContent()); }