Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("ID,RegistrationNumber,Km,ManufacutreDate,Status,Brand,Model,Class,Price")] Car car)
        {
            if (ModelState.IsValid)
            {
                _context.Add(car);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(car));
        }
        public async Task <IActionResult> Create([Bind("ID,CNP")] UnwantedUser unwantedUser)
        {
            if (ModelState.IsValid)
            {
                _context.Add(unwantedUser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(unwantedUser));
        }
        public async Task <IActionResult> Create([Bind("ID,User,Car,Start,End")] History history)
        {
            if (ModelState.IsValid)
            {
                _context.Add(history);
                await _context.SaveChangesAsync();

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