public async Task <IActionResult> Rename([FromBody] SettingFeatureCommand command) { var settingFeature = await _settingFeatureRepository.GetByIdAsync(command.Id); settingFeature.Rename(command.Name); await _settingFeatureRepository.CommitAsync(); return(Ok()); }
public async Task <IActionResult> Update([FromBody] SettingFeatureCommand command) { var settingFeature = await _settingFeatureRepository.GetByIdAsync(command.Id); settingFeature.Update( command.Name, command.Description, command.Icon, JsonConvert.SerializeObject(command.Settings)); await _settingFeatureRepository.CommitAsync(); return(Ok()); }
public async Task <IActionResult> Create([FromBody] SettingFeatureCommand command) { var settingFeature = command.To <SettingFeature>(); var any = await _settingFeatureRepository.AnyAsync(); if (any) { await _treeRepository.InsertNodeBeforeAnother(settingFeature, command.Parent); } else { await _treeRepository.InsertFirstRootNode(settingFeature); } return(Ok()); }
public async Task <IActionResult> InsertFirstRootNode(SettingFeatureCommand command) { await _treeRepository.InsertFirstRootNode(command.To <SettingFeature>()); return(Ok()); }
public async Task <IActionResult> InsertNodeAfterAnother(SettingFeatureCommand command, Guid refNodeId) { await _treeRepository.InsertNodeAfterAnother(command.To <SettingFeature>(), refNodeId); return(Ok()); }
public async Task <IActionResult> InsertLastChildNode(SettingFeatureCommand command, Guid refNodeId) { await _treeRepository.InsertLastChildNode(command.To <SettingFeature>(), refNodeId); return(Ok()); }