Esempio n. 1
0
 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"));
        }
Esempio n. 3
0
        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());
            }
        }
Esempio n. 4
0
 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)));
 }
Esempio n. 6
0
 public bool Remove(int id)
 {
     return(_carRepo.Delete(id));
 }