Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Id,Make,ReleaseDate,Model,Price,Trim")] Car car)
        {
            if (ModelState.IsValid)
            {
                _context.Add(car);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(car));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("ID,Placa,Marca,NumeroSerie,Modelo")] Car car)
        {
            if (ModelState.IsValid)
            {
                _context.Add(car);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(car));
        }