public async Task <IActionResult> Edit(int id, [Bind("ZhearaboutId,hearabout")] Zhearabout zhearabout) { if (id != zhearabout.ZhearaboutId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(zhearabout); TempData["Alert"] = String.Format("Saved Changes to Hear About: {0}", zhearabout.hearabout); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ZhearaboutExists(zhearabout.ZhearaboutId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(zhearabout)); }
public async Task <IActionResult> Create([Bind("ZhearaboutId,hearabout")] Zhearabout zhearabout) { if (ModelState.IsValid) { _context.Add(zhearabout); TempData["Alert"] = String.Format("Added Hear About: {0}", zhearabout.hearabout); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(zhearabout)); }