Exemple #1
0
        public async Task <IActionResult> Create([Bind("FirstName,LastName,Email,Age,UserPassword,UserId,Funds")] CoffeeUser coffeeUser)
        {
            if (ModelState.IsValid)
            {
                _context.Add(coffeeUser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(coffeeUser));
        }
        public async Task <IActionResult> Create([Bind("ItemId,ItemName,ItemDescription,ItemQuantity,ItemPrice")] Item item)
        {
            if (ModelState.IsValid)
            {
                _context.Add(item);
                await _context.SaveChangesAsync();

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