Esempio n. 1
0
 public IActionResult Edit(Make make)
 {
     if (ModelState.IsValid)
     {
         _vroomAppDbContext.Update(make);
         _vroomAppDbContext.SaveChanges();
         return(RedirectToAction(nameof(IndexMakeList)));
     }
     return(View());
 }
Esempio n. 2
0
        public IActionResult EditModelPost()
        {
            if (!ModelState.IsValid)
            {
                return(View(modelViewModel));
            }

            _vroomAppDbContext.Update(modelViewModel.Model);
            _vroomAppDbContext.SaveChanges();

            return(RedirectToAction(nameof(IndexModel)));
        }