public async Task <IActionResult> Edit(int id, [Bind("ID,bName,bEmail,bNumber")] BusinessContact businessContact) { if (id != businessContact.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(businessContact); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BusinessContactExists(businessContact.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(businessContact)); }
public async Task <IActionResult> Create([Bind("ID,bName,bEmail,bNumber")] BusinessContact businessContact) { if (ModelState.IsValid) { _context.Add(businessContact); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(businessContact)); }