예제 #1
0
        public IActionResult GetAdsDefaultOrder()
        {
            var order = OrderAdBy.TimeDesc;
            var ads   = _adService.Get(order);

            return(Ok(ads));
        }
예제 #2
0
        public IActionResult Ads()
        {
            var vm = new AdsViewModel
            {
                FilterAds  = new FilterAds(),
                Ads        = _adService.Get(),
                Categories = _categoryService.GetCategories()
            };

            return(View(vm));
        }
예제 #3
0
        public ActionResult <IEnumerable <AdResponse> > Get()
        {
            var ads = _service.Get();

            if (ads.Count() < 1)
            {
                return(NotFound());
            }

            return(Ok(ads));
        }
예제 #4
0
 public Ad Load(int?ID)
 {
     return(ID.HasValue ? new Ad(_adService.Get(ID.Value)) : new Ad());
 }
예제 #5
0
 public PagingResponse <AdResponse> Get([FromQuery] SieveModel sieveModel)
 {
     return(_adService.Get <AdResponse>(sieveModel));
 }