Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("name,cookingInstructions,peopleFed,glutenFree,vegetarian,vegan")] Recipe recipe)
        {
            if (ModelState.IsValid)
            {
                _context.Add(recipe);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(recipe));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("name,type,expDate,vendor,amount,cost")] Ingredient ingredient)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ingredient);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ingredient));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("username,email")] Login login)
        {
            if (ModelState.IsValid)
            {
                _context.Add(login);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(login));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Create([Bind("Name,Quantity,QuantityReserved,Description,Location")] Equipment equipment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(equipment);
                await _context.SaveChangesAsync();

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