private async Task ValidateDealerAsync(int id)
        {
            var dealerEntity = await repository.GetDealerAsync(id);

            if (dealerEntity == null)
            {
                throw new NotFoundException($"the id :{id} does not exist for dealer");
            }
        }
Example #2
0
        public async Task <DealerModel> GetDealerAsync(int id)
        {
            var resturantEntity = await repository.GetDealerAsync(id);

            if (resturantEntity == null)
            {
                throw new NotFoundException($"the id :{id} not exist");
            }
            else
            {
                return(mapper.Map <DealerModel>(resturantEntity));;
            }
        }