示例#1
0
        public async Task <IHttpActionResult> GetAdvert(int id)
        {
            Advert advert = await _advertRepository.GetAdvertByID(id);

            if (advert == null)
            {
                return(NotFound());
            }
            return(Ok(advert));
        }
        public IActionResult Get(int id)
        {
            var advert = _advertRepository.GetAdvertByID(id);

            return(new OkObjectResult(advert));
        }
        public async Task <AdvertDTO> GetByID(int advertId)
        {
            var foundAdvert = await _advertRepository.GetAdvertByID(advertId);

            return(_mapper.Map <AdvertDTO>(foundAdvert));
        }