Exemplo n.º 1
0
 public IActionResult Edit(Make make)
 {
     if (ModelState.IsValid)
     {
         _db.Update(make);
         _db.SaveChanges();
         return(RedirectToAction(nameof(Index)));
     }
     return(View(make));
 }
Exemplo n.º 2
0
 public IActionResult Edit(Make make)
 {
     if (ModelState.IsValid)
     {
         _context.Update(make);
         _context.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(make));
 }
 public IActionResult EditPost()
 {
     if (!ModelState.IsValid)
     {
         return(View(ModelVM));
     }
     _db.Update(ModelVM.Model);
     _db.SaveChanges();
     return(RedirectToAction(nameof(Index)));
 }
Exemplo n.º 4
0
 public IActionResult EditPost(BikeModelVM bikeModelVM)
 {
     if (!ModelState.IsValid)
     {
         return(View(ModelVM));
     }
     _context.Update(bikeModelVM.BikeModel);
     _context.SaveChanges();
     return(RedirectToAction(nameof(Index)));
 }
Exemplo n.º 5
0
        public IActionResult EditPost()
        {
            if (!ModelState.IsValid)
            {
                return(View(ModelViewModel));
            }

            mDbContext.Update(ModelViewModel.Model);
            mDbContext.SaveChanges();

            return(RedirectToAction(nameof(Index)));
        }
 public void Update(Bike bike)
 {
     _context.Update(bike);
 }