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)); } }
public IActionResult Get([FromQuery] AdQuery query) { return(Ok(_getCommand.Execute(query))); }
// GET: Ad public ActionResult Index(AdQuery search) { var ad = _getCommand.Execute(search); return(View(ad)); }