public ActionResult Product(int? productId, int? conditionId) { int pId = 1; int cId = 0; if (productId.HasValue) pId = productId.Value; if (conditionId.HasValue) cId = conditionId.Value; var search = _repository.GetSearchByProductID(pId); SearchSummary summary = new SearchSummary() { Name = search.Name, Description = search.Description, SearchID = search.SearchId, LastRun = search.LastRun, TotalResults = _repository.ResultCount(search.SearchId), Link = search.Link, ProductID = pId, ConditionID = cId }; return View(summary); }
public ActionResult Product(int? id) { int productId = 1; if (id.HasValue) productId = id.Value; var search = _repository.GetSearchByProductID(productId); if (search == null) return new HttpNotFoundResult(); SearchSummary summary = new SearchSummary() { Name = search.Name, Description = search.Description, SearchID = search.SearchId, LastRun = search.LastRun, TotalResults = _repository.ResultCount(search.SearchId), Link = search.Link, ProductID = productId }; return View(summary); }