public async Task<ActionResult> ViewProduct(string Id, string SearchID) { iDunnoDB db = new iDunnoDB(); TargetAPI api = new TargetAPI(); TargetItem item = new TargetItem(api.GetObjectData(Id)); await db.LogClick(SearchID, Id); return Redirect(item.Url); }
//POST home public async Task<ActionResult> Index(string search, HomeScreen screen) { iDunnoDB db = new iDunnoDB(); var iable = await db.LogSearch(search); TargetAPI api = new TargetAPI(); screen.SearchQuery = search; screen.QueryID = iable.Id.ToString(); List<TargetItem> items = new List<TargetItem>(); foreach (dynamic duo in api.FastSearch(search)) { items.Add(new TargetItem(duo)); } screen.Items = items; return View(screen); }