public async Task <IActionResult> Edit(int?id) { var session = HttpContext.Session.GetString("fullname"); if (session == null) { return(RedirectToAction("LoginForm", "User")); } if (id == null) { return(NotFound()); } var editCategory = await _categoryServices.FindId(id); if (editCategory == null) { return(NotFound()); } return(View(editCategory)); }