Esempio n. 1
0
        public ActionResult DeleteMenu(int id)
        {
            var deleteMenu = _menuManager.Get(id);

            _menuManager.Delete(id);

            return(RedirectToAction("ManagementMenu"));
        }
Esempio n. 2
0
        public async Task <IActionResult> Delete(long id)
        {
            try
            {
                await _menuManager.Delete(id);

                return(Json(new { Result = true }));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = false, Message = ex.Message }));
            }
        }
Esempio n. 3
0
        public async Task <IActionResult> Delete([FromBody] Menus inputModel)
        {
            try
            {
                var data = await _menuManager.Find_By_Id(inputModel.Id);

                if (data == null)
                {
                    throw new Exception($"{MessageConst.DATA_NOT_FOUND}");
                }
                await _menuManager.Delete(inputModel.Id);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex.Message));
            }
        }
 public async Task <ApiResponse> Delete(int id) =>
 await manager.Delete(id);