public async Task <IActionResult> Edit(int id, [Bind("car_id,make,model,year,is_active,created_at")] Cars_Mario cars_Mario) { if (id != cars_Mario.car_id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cars_Mario); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Cars_MarioExists(cars_Mario.car_id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cars_Mario)); }
public async Task <IActionResult> Create([Bind("car_id,make,model,year,is_active,created_at")] Cars_Mario cars_Mario) { if (ModelState.IsValid) { _context.Add(cars_Mario); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(cars_Mario)); }