public IActionResult Delete(int id, Car car) { if (id != car.Id) { return(BadRequest()); } _repo.Delete(car); return(RedirectToAction(nameof(Index))); }
public IActionResult OnPost(int?id) { if (!id.HasValue) { return(NotFound()); } if (Car.Id != id) { return(BadRequest()); } _repo.Delete(Car); return(RedirectToPage("./Index")); }
public IActionResult OnPost(int?id) { if (!id.HasValue) { return(NotFound()); } if (Car.Id != id) { return(BadRequest()); } try { _repo.Delete(Car); return(RedirectToPage("./Index")); } catch (Exception ex) { ModelState.AddModelError(string.Empty, ex.Message); return(Page()); } }
public IActionResult Delete(int id, Car car) { _repo.Delete(car); return(RedirectToAction(nameof(Index))); }
public IActionResult Delete(int id, byte[] timeStamp) { _repo.Delete(id, timeStamp); return(RedirectToAction(nameof(Index))); }
public bool Remove(int id) { return(_carRepo.Delete(id)); }