public IActionResult Delete(string id) { try { if (string.IsNullOrEmpty(id)) { return(RedirectToAction("ViewAllLights", "AllLight")); } int result = _ILight.DeleteLight(Convert.ToInt32(id)); if (result > 0) { return(Json(data: true)); } else { return(Json(data: false)); } } catch (Exception) { throw; } }