public async Task <IActionResult> Create([Bind("Id,TotalCalories,TotalCarbs,TotalFats,TotalProtein")] Total total)
        {
            if (ModelState.IsValid)
            {
                _context.Add(total);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(total));
        }
        public async Task <IActionResult> Create([Bind("ID,Name,Food_Group,Calories,Fat_g,Protein_g,Carbohydrate_g")] Master_Food master_Food)
        {
            if (ModelState.IsValid)
            {
                _context.Add(master_Food);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(master_Food));
        }
示例#3
0
        public async Task <IActionResult> Create([Bind("FoodId,FoodName,Calories,Fat,Carbs,Protein,Sugar")] MacronutrientMeasurement macronutrientMeasurement)
        {
            if (ModelState.IsValid)
            {
                _context.Add(macronutrientMeasurement);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(macronutrientMeasurement));
        }
示例#4
0
        public async Task <IActionResult> Create([Bind("UserId,FirstName,LastName,Email,UserPassword,Height,Weight,Age")] AccountInfo accountInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(accountInfo);
                await _context.SaveChangesAsync();

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