Example #1
0
        public ActionResult Delete(int?id, AdSearch search)
        {
            var ads      = _listAdCommand.Execute(search);
            var singleAd = ads.Where(w => w.Id == id).First();

            return(View(singleAd));
        }
 public IActionResult GetAll([FromQuery] AdSearch request)
 {
     try
     {
         var response = _getAdsCommand.Execute(request);
         return(Ok(response));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, ex.Message));
     }
 }
Example #3
0
 public IActionResult Get([FromQuery] AdQuery query)
 {
     return(Ok(_getCommand.Execute(query)));
 }
Example #4
0
        // GET: Ad
        public ActionResult Index(AdQuery search)
        {
            var ad = _getCommand.Execute(search);

            return(View(ad));
        }