public IActionResult Search(string title) { if (String.IsNullOrEmpty(title)) { return(View("Index", new List <Offer>())); } ViewBag.Search = title.Trim(); string xmlPath = _webHostEnvironment.ContentRootPath + "\\offers.xml"; return(View("Index", OfferParser.QueryOffer(title.Trim(), xmlPath))); }
public ActionResult Search(string title) { if (String.IsNullOrEmpty(title)) { return(View("Index")); } string appdata = Server.MapPath("~/App_Data"); string xmlPath = Path.Combine(appdata, "offers.xml"); List <Offer> offers = OfferParser.QueryOffer(title, xmlPath); return(View(offers)); }