Esempio n. 1
0
        public async Task <IActionResult> OnPostDeleteAsync(string[] ids)
        {
            var entity = await _sysMenuService.GetFullListAsync(_ => ids.Contains(_.Id));

            var buttons = await _sysButtonService.GetFullListAsync(_ => ids.Contains(_.MenuId));

            await _sysButtonService.DeleteAllAsync(buttons);

            await _sysMenuService.DeleteAllAsync(entity);

            await _sysMenuService.RemoveMenuAsync();

            return(Ok(true));
        }
Esempio n. 2
0
        public async Task <IActionResult> OnPostDeleteAsync([FromBody] string[] ids)
        {
            var entity = await _sysMenuService.GetFullListAsync(_ => ids.Contains(_.Id) && _.IsLocked == false);

            var buttons = await _sysButtonService.GetFullListAsync(_ => ids.Contains(_.MenuId));

            await _sysButtonService.DeleteAllAsync(buttons);

            await _sysMenuService.DeleteAllAsync(entity);

            await _sysMenuService.RemoveMenuAsync();

            IEnumerable <string> unDeleteIds = ids.Except(entity.Select(_ => _.Id));

            return(Ok(unDeleteIds));
        }