public ResponseModel <bool> Delete(int id) { var resp = new ResponseModel <bool>(); try { if (id == 0) { throw new Exception("Id not found"); } var groupObj = AppRepo.GetById(id); if (groupObj != null) { AppRepo.Delete(groupObj); resp.Status = 200; resp.Data = true; resp.Description = "OK"; } else { throw new Exception("id not exist"); } } catch (Exception ex) { resp.Status = 500; resp.Description = $"Error: {ex.Message}"; resp.Data = true; } return(resp); }