Beispiel #1
0
        public async Task <IActionResult> Create([Bind("Id,Title,ReleaseDate,Price,Weight")] Car car)
        {
            if (ModelState.IsValid)
            {
                _context.Add(car);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(car));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Id,Marka,Model,Pojemnosc,Moc,Rocznik")] Car car)
        {
            if (ModelState.IsValid)
            {
                _context.Add(car);
                await _context.SaveChangesAsync();

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