public async Task <ActionResult <Dealer> > GetDealer(int id)
        {
            var dealer = await _repository.GetById(id);

            if (dealer == null)
            {
                return(NotFound());
            }

            return(dealer);
        }
Esempio n. 2
0
        // 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));
        }
Esempio n. 3
0
        public IActionResult GetDealerById(int dealerId)
        {
            var dealer = _dealerRepo.GetById(dealerId);

            if (dealer != null)
            {
                return(Ok(dealer));
            }
            else
            {
                return(BadRequest("Dealer not found."));
            }
        }
Esempio n. 4
0
        public Dealer GetDealer(int dealerId)
        {
            Dealer dealer = dealerRepository.GetById(dealerId) as Dealer;

            return(dealer);
        }