public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Address,PostalCode,Email,CellPhone")] DogBreeder dogBreeder) { if (id != dogBreeder.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(dogBreeder); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DogBreederExists(dogBreeder.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dogBreeder)); }
public async Task <IActionResult> Create([Bind("Id,Name,Address,PostalCode,Email,CellPhone")] DogBreeder dogBreeder) { if (ModelState.IsValid) { _context.Add(dogBreeder); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dogBreeder)); }