Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        public async Task <IActionResult> InsertFirstRootNode(SettingAdvancedCommand command)
        {
            await _treeRepository.InsertFirstRootNode(command.To <SettingAdvanced>());

            return(Ok());
        }
Esempio n. 3
0
        public async Task <IActionResult> InsertNodeAfterAnother(SettingAdvancedCommand command, Guid refNodeId)
        {
            await _treeRepository.InsertNodeAfterAnother(command.To <SettingAdvanced>(), refNodeId);

            return(Ok());
        }
Esempio n. 4
0
        public async Task <IActionResult> InsertFirstChildNode(SettingAdvancedCommand command, Guid refNodeId)
        {
            await _treeRepository.InsertFirstChildNode(command.To <SettingAdvanced>(), refNodeId);

            return(Ok());
        }