public async Task <IActionResult> Create([Bind("ID,Name,EmailAddress")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Create([Bind("ID,Name,Abbreviation,IsBaseUnit")] Unit unit) { if (ModelState.IsValid) { _context.Add(unit); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(unit)); }
public async Task <IActionResult> Create([Bind("ID,Name,CostPer100g,WeightPerUnit")] Ingredient ingredient) { if (ModelState.IsValid) { _context.Add(ingredient); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ingredient)); }
public async Task <IActionResult> Create([Bind("ID,Name")] Book book) { if (ModelState.IsValid) { _context.Add(book); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(book)); }
public async Task <IActionResult> Create([Bind("ID,Name,PageNumber,MakeAhead,LongerRecipe,GoodToFreeze,IngredientsComplete,StepsComplete")] Recipe recipe) { if (ModelState.IsValid) { _context.Add(recipe); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(recipe)); }