public IActionResult Delete(int id) { var temp = carData.Delete(id); if (temp == null) { return(BadRequest()); } carData.Commit(); return(NoContent()); }
public IActionResult OnPost(int carId) { var temp = carData.Delete(carId); if (temp == null) { return(RedirectToPage("./NotFound")); } carData.Commit(); TempData["TempMessage"] = "The car was deleted."; return(RedirectToPage("./CarModels")); }
public async Task <ActionResult> Delete(int id, FormCollection form) { await db.Delete(id); return(RedirectToAction("Index")); }