public async Task <IActionResult> Delete(int ID) { try { if (ID > 0) { bool flag = false; using (var uow = _uowFactory.Create()) { flag = await _SysMenuRepository.DeleteAsync(ID); uow.SaveChanges(); } if (flag) { return(Ok(new { status = true, message = "success" })); } else { return(Ok(new { status = false, message = "error" })); } } else { return(Ok(new { status = false, message = "del error" })); } } catch (Exception ex) { return(Ok(new { status = false, message = ex.Message })); } }