Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("checkoutId,checkoutLicensePlate,checkoutTime")] CarCheckOut carCheckOut)
        {
            if (ModelState.IsValid)
            {
                _context.Add(carCheckOut);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(carCheckOut));
        }
        public async Task <IActionResult> Create(Product product)
        {
            if (ModelState.IsValid)
            {
                product.createdDate = DateTime.Now;
                _context.Add(product);
                await _context.SaveChangesAsync();

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