public ActionResult AddCar(int personId) { var repo = new PeopleCarsRepository(Properties.Settings.Default.ConStr); var person = repo.GetById(personId); if (person == null) { return(RedirectToAction("Index")); } return(View(person)); }
public Person GetPersonById(int id) { var repo = new PeopleCarsRepository(_connectionString); return(repo.GetById(id)); }