public async Task <IActionResult> Create([Bind("ID,LastName,FirstName,EnrollmentDate,City,EmailAddress,PhoneNumber,Occupation")] Owner owner) { if (ModelState.IsValid) { _context.Add(owner); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(owner)); }
public async Task <IActionResult> Create([Bind("ID,Name,DOB,OwnerID,Breed")] Pet pet) { if (ModelState.IsValid) { _context.Add(pet); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["OwnerID"] = new SelectList(_context.Owner, "ID", "ID", pet.OwnerID); return(View(pet)); }