Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }