// GET: Cars/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Car car = carRepository.GetCar(id); if (car == null) { return(HttpNotFound()); } return(View(car)); }
internal Car Get(int id) { Car car = _repo.GetCar(id); if (car == null) { throw new Exception("Invalid ID"); } return(car); }
public void GetCar_Test() { //Arrange CarsRepository repo = new CarsRepository(); //Act var cars = repo.GetCar(2); //Assert Assert.IsNotNull(cars); }
public Car Get(int id) { return(repo.GetCar(id)); }
private DisplayCarModel GetSelectedCar(CarsRepository repository, long selectedCarId) { return(repository.GetCar(selectedCarId)); }
public async Task <CarModel> GetCar(string reg) { return(await _repo.GetCar(reg)); }