public IActionResult Add(AddWalkViewModel addWalkViewModel) { if (ModelState.IsValid) { Walk newWalk = new Walk { Distance = addWalkViewModel.Distance, Poop = addWalkViewModel.Poop, Pee = addWalkViewModel.Pee, Date = addWalkViewModel.Date, Time = addWalkViewModel.Time, Notes = addWalkViewModel.Notes, }; context.Walks.Add(newWalk); context.SaveChanges(); return(Redirect("/Walk")); } return(View(addWalkViewModel)); }
public IActionResult Add() { AddWalkViewModel addWalkViewModel = new AddWalkViewModel(); return(View(addWalkViewModel)); }