public async Task <ActionResult <Dealer> > GetDealer(int id) { var dealer = await _repository.GetById(id); if (dealer == null) { return(NotFound()); } return(dealer); }
// GET: Dealers/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var dealer = await _repository.GetById(id.Value); if (dealer == null) { return(NotFound()); } return(View(dealer)); }
public IActionResult GetDealerById(int dealerId) { var dealer = _dealerRepo.GetById(dealerId); if (dealer != null) { return(Ok(dealer)); } else { return(BadRequest("Dealer not found.")); } }
public Dealer GetDealer(int dealerId) { Dealer dealer = dealerRepository.GetById(dealerId) as Dealer; return(dealer); }