public IActionResult Edit(string id) { try { if (string.IsNullOrEmpty(id)) { return(RedirectToAction("ViewAllLights", "AllLight")); } Light lightEdit = _ILight.LightByID(Convert.ToInt32(id)); return(View("Edit", lightEdit)); } catch (Exception) { throw; } }