public async Task <IActionResult> Create([FromBody] SettingAdvancedCommand command) { var settingAdvanced = command.To <SettingAdvanced>(); var any = await _settingAdvancedRepository.AnyAsync(); if (any) { await _treeRepository.InsertNodeBeforeAnother(settingAdvanced, command.Parent); } else { await _treeRepository.InsertFirstRootNode(settingAdvanced); } return(Ok()); }
public async Task <IActionResult> InsertFirstRootNode(SettingAdvancedCommand command) { await _treeRepository.InsertFirstRootNode(command.To <SettingAdvanced>()); return(Ok()); }
public async Task <IActionResult> InsertNodeAfterAnother(SettingAdvancedCommand command, Guid refNodeId) { await _treeRepository.InsertNodeAfterAnother(command.To <SettingAdvanced>(), refNodeId); return(Ok()); }
public async Task <IActionResult> InsertFirstChildNode(SettingAdvancedCommand command, Guid refNodeId) { await _treeRepository.InsertFirstChildNode(command.To <SettingAdvanced>(), refNodeId); return(Ok()); }